MCPcopy Create free account
hub / github.com/Keyang/node-csvtojson / concatLeftChunk

Function concatLeftChunk

src/dataClean.ts:35–41  ·  view source on GitHub ↗

* append data to buffer that is left form last chunk

(chunk: Buffer, runtime: ParseRuntime)

Source from the content-addressed store, hash-verified

33 * append data to buffer that is left form last chunk
34 */
35function 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 */

Callers 1

prepareDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected