chore: lint

This commit is contained in:
karishmas6
2024-08-12 06:35:00 +05:30
parent 286a39662d
commit 6cafc9ef2d

View File

@@ -291,7 +291,7 @@ export default class Interpreter extends EventEmitter {
await this.options.serializableCallback(scrapeResult);
},
scrapeList: async (config: { listSelector: string, fields: any, limit?: number, flexible?: boolean, pagination:any }) => {
scrapeList: async (config: { listSelector: string, fields: any, limit?: number, flexible?: boolean, pagination: any }) => {
await this.ensureScriptsLoaded(page);
const scrapeResults: Record<string, any>[] = await page.evaluate((cfg) => window.scrapeList(cfg), config);
await this.options.serializableCallback(scrapeResults);
@@ -315,6 +315,7 @@ export default class Interpreter extends EventEmitter {
}
}, pages ?? 1);
},
script: async (code: string) => {
const AsyncFunction: FunctionConstructor = Object.getPrototypeOf(
async () => { },
@@ -322,6 +323,7 @@ export default class Interpreter extends EventEmitter {
const x = new AsyncFunction('page', 'log', code);
await x(page, this.log);
},
flag: async () => new Promise((res) => {
this.emit('flag', page, res);
}),