(chunk: Buffer, runtime: ParseRuntime)
| 20 | * 3. stripBom |
| 21 | */ |
| 22 | export function prepareData(chunk: Buffer, runtime: ParseRuntime): string { |
| 23 | const workChunk = concatLeftChunk(chunk, runtime); |
| 24 | runtime.csvLineBuffer = undefined; |
| 25 | const cleanCSVString = cleanUtf8Split(workChunk, runtime).toString("utf8"); |
| 26 | if (runtime.started === false) { |
| 27 | return stripBom(cleanCSVString); |
| 28 | } else { |
| 29 | return cleanCSVString; |
| 30 | } |
| 31 | } |
| 32 | /** |
| 33 | * append data to buffer that is left form last chunk |
| 34 | */ |
no test coverage detected