导出布尔值优化

This commit is contained in:
2020-11-02 21:48:01 +08:00
parent 777ed03d3e
commit 9209b17b06
3 changed files with 3 additions and 1 deletions

1
.vscode/launch.json vendored
View File

@@ -8,6 +8,7 @@
"skipFiles": [
"<node_internals>/**"
],
"cwd": "D:/work/repositories/zombie/config/新配表",
"program": "${workspaceFolder}/dist/binary.js",
"args": [
"./excel-exporter.json"

View File

@@ -256,7 +256,7 @@ export class TableParser {
protected get_cell_value(cell: xlsl.CellObject, type: DataType) {
switch (type) {
case DataType.bool:
return cell.v as boolean == true;
return cell && cell.v as boolean == true;
case DataType.int:
return cell ? cell.v as number : 0;
case DataType.float:

View File

@@ -40,6 +40,7 @@ export class TypeScriptExporter extends TableExporter {
switch (field.type) {
case DataType.bool:
type = "boolean";
break;
case DataType.string:
type = "string";
break;