chore: lint

This commit is contained in:
karishmas6
2024-08-03 02:20:59 +05:30
parent 92db9e5b93
commit 25eb58945e

View File

@@ -281,22 +281,22 @@ export default class Interpreter extends EventEmitter {
const scrapeResults: Record<string, string>[] = await page.evaluate((s) => window.scrape(s ?? null), selector);
await this.options.serializableCallback(scrapeResults);
},
},
scrapeSchema: async (schema: Record<string, string>) => {
await this.ensureScriptsLoaded(page);
scrapeSchema: async (schema: Record<string, string>) => {
await this.ensureScriptsLoaded(page);
const handleLists = await Promise.all(
Object.values(schema).map((selector) => page.$$(selector)),
Object.values(schema).map((selector) => page.$$(selector)),
);
const namedHandleLists = Object.fromEntries(
Object.keys(schema).map((key, i) => [key, handleLists[i]]),
Object.keys(schema).map((key, i) => [key, handleLists[i]]),
);
const scrapeResult = await page.evaluate((n) => window.scrapeSchema(n), namedHandleLists);
await this.options.serializableCallback(scrapeResult);
},
},
scroll: async (pages?: number) => {
await page.evaluate(async (pagesInternal) => {