Archived
2

restructured aggregation

This commit is contained in:
VLE2FE
2020-07-02 12:18:01 +02:00
parent 8cf1c14d88
commit e4bc5a77f1
9 changed files with 180 additions and 61 deletions

View File

@ -1,7 +1,13 @@
import {parseAsync} from 'json2csv';
export default function csv(input: any[], f: (err, data) => void) {
parseAsync(input.map(e => flatten(e)))
console.log(input[1000]);
console.log(flatten(input[1000]));
parseAsync([flatten(input[1000])]).then(csv => console.log(csv));
console.log(input[1]);
console.log(flatten(input[1]));
parseAsync([flatten(input[1])]).then(csv => console.log(csv));
parseAsync(input.map(e => flatten(e)), {includeEmptyRows: true})
.then(csv => f(null, csv))
.catch(err => f(err, null));
}