From c2a210cc815c3aa06f6f14d33954f65577d95954 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 18 Sep 2020 17:28:29 -0400 Subject: [PATCH] fix: small error in `isOutOfStock` logic (#33) --- src/index.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index b13a0a7..9815334 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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)); } /**