(filePath: string)
| 8 | |
| 9 | export class HtmlParser implements FileParser { |
| 10 | async parseFile(filePath: string): Promise<FileParseResult> { |
| 11 | try { |
| 12 | if (!filePath) { |
| 13 | throw new Error('No file path provided') |
| 14 | } |
| 15 | |
| 16 | const buffer = await readFile(filePath) |
| 17 | return this.parseBuffer(buffer) |
| 18 | } catch (error) { |
| 19 | logger.error('HTML file error:', error) |
| 20 | throw new Error(`Failed to parse HTML file: ${(error as Error).message}`) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | async parseBuffer(buffer: Buffer): Promise<FileParseResult> { |
| 25 | try { |
nothing calls this directly
no test coverage detected