From 89fed62dcc2d8c4cfea118f28acc6e5c8aa1824c Mon Sep 17 00:00:00 2001 From: Geequlim Date: Tue, 26 Jan 2021 17:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A30=E5=80=BC=E5=9C=A8=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E4=B8=AD=E7=9A=84=E5=AF=BC=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/excel-exporter/TableParser.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/excel-exporter/TableParser.ts b/src/excel-exporter/TableParser.ts index ae4099b..2608079 100644 --- a/src/excel-exporter/TableParser.ts +++ b/src/excel-exporter/TableParser.ts @@ -164,17 +164,18 @@ export class Field { let obj = {}; let isAllNullish = true; 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) { let arr: any[] = obj[c.name] || []; - if (this.constant_array_length || value) { + if (this.constant_array_length || value !== null) { arr.push(value); } obj[c.name] = arr; } else { obj[c.name] = value; } - isAllNullish = isAllNullish && c.check_is_null(row); + isAllNullish = isAllNullish && is_null; } return isAllNullish ? null : obj; }