(filePath: string)
| 19 | |
| 20 | export class DocxParser implements FileParser { |
| 21 | async parseFile(filePath: string): Promise<FileParseResult> { |
| 22 | try { |
| 23 | if (!filePath) { |
| 24 | throw new Error('No file path provided') |
| 25 | } |
| 26 | |
| 27 | const buffer = await readFile(filePath) |
| 28 | return this.parseBuffer(buffer) |
| 29 | } catch (error) { |
| 30 | logger.error('DOCX file error:', error) |
| 31 | throw new Error(`Failed to parse DOCX file: ${(error as Error).message}`) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | async parseBuffer(buffer: Buffer): Promise<FileParseResult> { |
| 36 | try { |
nothing calls this directly
no test coverage detected