This commit is contained in:
Jan Prochazka
2021-01-23 07:20:44 +01:00
parent 7f5143aac2
commit 37cc86f8d2
19 changed files with 48 additions and 53 deletions

View File

@@ -13,7 +13,7 @@ class ParseStream extends stream.Transform {
_transform(chunk, encoding, done) {
const obj = JSON.parse(chunk);
if (!this.wasHeader) {
if (!this.header) this.push({ columns: Object.keys(obj).map((columnName) => ({ columnName })) });
if (!this.header) this.push({ columns: Object.keys(obj).map(columnName => ({ columnName })) });
this.wasHeader = true;
}
if (!this.limitRows || this.rowsWritten < this.limitRows) {