* append data to buffer that is left form last chunk
(chunk: Buffer, runtime: ParseRuntime)
| 33 | * append data to buffer that is left form last chunk |
| 34 | */ |
| 35 | function concatLeftChunk(chunk: Buffer, runtime: ParseRuntime): Buffer { |
| 36 | if (runtime.csvLineBuffer && runtime.csvLineBuffer.length > 0) { |
| 37 | return Buffer.concat([runtime.csvLineBuffer, chunk]); |
| 38 | } else { |
| 39 | return chunk; |
| 40 | } |
| 41 | } |
| 42 | /** |
| 43 | * check if utf8 chars being split, if does, stripe the bytes and add to left buffer. |
| 44 | */ |