(filePath: string)
| 9 | |
| 10 | export class PptxParser implements FileParser { |
| 11 | async parseFile(filePath: string): Promise<FileParseResult> { |
| 12 | try { |
| 13 | if (!filePath) { |
| 14 | throw new Error('No file path provided') |
| 15 | } |
| 16 | |
| 17 | if (!existsSync(filePath)) { |
| 18 | throw new Error(`File not found: ${filePath}`) |
| 19 | } |
| 20 | |
| 21 | logger.info(`Parsing PowerPoint file: ${filePath}`) |
| 22 | |
| 23 | const buffer = await readFile(filePath) |
| 24 | return this.parseBuffer(buffer) |
| 25 | } catch (error) { |
| 26 | logger.error('PowerPoint file parsing error:', error) |
| 27 | throw new Error(`Failed to parse PowerPoint file: ${(error as Error).message}`) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | async parseBuffer(buffer: Buffer): Promise<FileParseResult> { |
| 32 | try { |
nothing calls this directly
no test coverage detected