mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
fix: small error in isOutOfStock logic (#33)
This commit is contained in:
+1
-6
@@ -80,12 +80,7 @@ async function lookup(store: Store) {
|
||||
*/
|
||||
function isOutOfStock(domText: string, oosLabels: string[]) {
|
||||
const domTextLowerCase = domText.toLowerCase();
|
||||
let result = false;
|
||||
for (const oosLabel of oosLabels) {
|
||||
result = domTextLowerCase.includes(oosLabel.toLowerCase());
|
||||
}
|
||||
|
||||
return result;
|
||||
return oosLabels.some(label => domTextLowerCase.includes(label));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user