fix: add support for stores label text to have uppercase letters (#526)

This commit is contained in:
Farsab Nazir Butt
2020-10-19 17:19:16 +02:00
committed by GitHub
parent 542b92301a
commit 5ea7cc4ca4
+1 -1
View File
@@ -86,7 +86,7 @@ export async function extractPageContents(page: Page, selector: Selector): Promi
*/ */
export function includesLabels(domText: string, searchLabels: string[]): boolean { export function includesLabels(domText: string, searchLabels: string[]): boolean {
const domTextLowerCase = domText.toLowerCase(); const domTextLowerCase = domText.toLowerCase();
return searchLabels.some(label => domTextLowerCase.includes(label)); return searchLabels.some(label => domTextLowerCase.includes(label.toLowerCase()));
} }
export async function cardPrice(page: Page, query: Pricing, max: number, options: Selector) { export async function cardPrice(page: Page, query: Pricing, max: number, options: Selector) {