()
| 18 | } |
| 19 | const validScraperTypes = new Set([ScraperType.REQUEST, ScraperType.BROWSER, ScraperType.TASK]); |
| 20 | function getReadme(): string { |
| 21 | try { |
| 22 | const readmeFile = getReadmePath(); |
| 23 | |
| 24 | const text = fs.readFileSync(readmeFile, 'utf-8'); |
| 25 | return text; |
| 26 | } catch (error) { |
| 27 | if (isNoentError(error)) { |
| 28 | return ''; |
| 29 | } |
| 30 | throw error; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | export function getScraperErrorMessage(validScraperNames: string[], scraperName: string | null, validNamesString: string) { |
| 35 | if (validScraperNames.length === 0) { |
no test coverage detected