(filePath: string)
| 16 | |
| 17 | export class CsvParser implements FileParser { |
| 18 | async parseFile(filePath: string): Promise<FileParseResult> { |
| 19 | if (!filePath) { |
| 20 | throw new Error('No file path provided') |
| 21 | } |
| 22 | |
| 23 | if (!existsSync(filePath)) { |
| 24 | throw new Error(`File not found: ${filePath}`) |
| 25 | } |
| 26 | |
| 27 | const stream = createReadStream(filePath, { |
| 28 | highWaterMark: CONFIG.STREAM_CHUNK_SIZE, |
| 29 | }) |
| 30 | |
| 31 | return this.parseStream(stream) |
| 32 | } |
| 33 | |
| 34 | async parseBuffer(buffer: Buffer): Promise<FileParseResult> { |
| 35 | const bufferSize = buffer.length |
nothing calls this directly
no test coverage detected