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

Method processCSVBody

src/ProcessorLocal.ts:200–217  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

198
199 }
200 private processCSVBody(lines: string[]): ProcessLineResult[] {
201 if (this.params.output === "line") {
202 return lines;
203 } else {
204 const result = this.rowSplit.parseMultiLines(lines);
205 this.prependLeftBuf(bufFromString(result.partial));
206 if (this.params.output === "csv") {
207 return result.rowsCells;
208 } else {
209 return lineToJson(result.rowsCells, this.converter);
210 }
211 }
212
213 // var jsonArr = linesToJson(lines.lines, params, this.recordNum);
214 // this.processResult(jsonArr);
215 // this.lastIndex += jsonArr.length;
216 // this.recordNum += jsonArr.length;
217 }
218
219 private prependLeftBuf(buf: Buffer) {
220 if (buf) {

Callers 5

processCSVMethod · 0.95
processDataWithHeadMethod · 0.95
browser.jsFile · 0.80
csvtojson.min.jsFile · 0.80
ProcessorLocal.jsFile · 0.80

Calls 3

prependLeftBufMethod · 0.95
bufFromStringFunction · 0.90
parseMultiLinesMethod · 0.80

Tested by

no test coverage detected