1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 10:08:52 +08:00

Update csv.js

This commit is contained in:
twoxfh
2021-06-08 06:13:00 -07:00
committed by GitHub
parent 379ee1a67b
commit 5b3f34cb63

View File

@@ -28,7 +28,7 @@ export default {
},
parse (file, config = {}) {
let parsedData = {}
let parsedData = null
return new Promise((resolve, reject) => {
const defaultConfig = {
delimiter: '', // auto-detect
@@ -44,7 +44,7 @@ export default {
comments: false,
step: undefined,
chunk: results => {
if (Object.keys(parsedData).length === 0 && parsedData.constructor === Object) {
if (parsedData === null) {
parsedData = results
} else {
parsedData.data = parsedData.data.concat(results.data)