Skip to content

Commit fced209

Browse files
output eol between ndjson lines
1 parent ef17f9b commit fced209

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

libs/core/Converter.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,11 @@ Converter.prototype.flushBuffer = function() {
183183
resultJSONStr=JSON.stringify(resultRow);
184184
}
185185
this.emit("record_parsed", resultRow, row, index);
186-
if (this.param.toArrayString && this.recordNum > 0) {
187-
this.push("," + eol);
186+
if (this.recordNum > 0) {
187+
if (this.param.toArrayString) {
188+
this.push(",");
189+
}
190+
this.push(eol);
188191
}
189192
if (this._options && this._options.objectMode){
190193
this.push(resultRow);

0 commit comments

Comments
 (0)