(scraperName: string)
| 404 | } |
| 405 | |
| 406 | getInputJs(scraperName: string): string { |
| 407 | const inputJsPath = getInputFilePath(scraperName) |
| 408 | let inputJs: string | null = null; |
| 409 | |
| 410 | if (fs.existsSync(inputJsPath)) { |
| 411 | inputJs = replaceFileTypesInCode(fs.readFileSync(inputJsPath, 'utf-8')); |
| 412 | } else { |
| 413 | const scraperFilePath = getInputFilePath(scraperName) |
| 414 | throw new Error(`Input js file not found for ${scraperName}, at path ${scraperFilePath}. Kindly create it.`); |
| 415 | } |
| 416 | |
| 417 | return inputJs; |
| 418 | } |
| 419 | |
| 420 | getScrapingFunction(scraperName: string): Function { |
| 421 | return this.scrapers[scraperName].function; |
no test coverage detected