修正0值在数组中的导出问题

This commit is contained in:
2021-01-26 17:07:29 +08:00
parent dac89497d0
commit 89fed62dcc

View File

@@ -164,17 +164,18 @@ export class Field {
let obj = {}; let obj = {};
let isAllNullish = true; let isAllNullish = true;
for (const c of this.children) { for (const c of this.children) {
let value = c.parse_row(row); const value = c.parse_row(row);
const is_null = this.check_is_null(row);
if (c.is_array) { if (c.is_array) {
let arr: any[] = obj[c.name] || []; let arr: any[] = obj[c.name] || [];
if (this.constant_array_length || value) { if (this.constant_array_length || value !== null) {
arr.push(value); arr.push(value);
} }
obj[c.name] = arr; obj[c.name] = arr;
} else { } else {
obj[c.name] = value; obj[c.name] = value;
} }
isAllNullish = isAllNullish && c.check_is_null(row); isAllNullish = isAllNullish && is_null;
} }
return isAllNullish ? null : obj; return isAllNullish ? null : obj;
} }