Skip to content

Commit

Permalink
fix: small error in isOutOfStock logic (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
vp-regular committed Sep 18, 2020
1 parent aa856c7 commit c2a210c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/index.ts
Expand Up @@ -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));
}

/**
Expand Down

0 comments on commit c2a210c

Please sign in to comment.