修正上一次提交导致数组导出错误

添加调试配置
This commit is contained in:
2020-12-24 17:58:07 +08:00
parent dc4ccb0aad
commit bb97ff3b1e
2 changed files with 12 additions and 7 deletions

9
.vscode/launch.json vendored
View File

@@ -9,8 +9,13 @@
"skipFiles": [
"<node_internals>/**"
],
// "cwd": "D:/work/repositories/zombie/config/新配表",
"cwd": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack:///./~/*": "${workspaceRoot}/node_modules/*",
"webpack:///./*": "${workspaceRoot}/*",
"webpack:///*": "*"
},
"cwd": "D:/work/repositories/zombie/config/新配表",
// "cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/dist/binary.js",
"args": [
"./excel-exporter.yaml"

View File

@@ -87,11 +87,12 @@ export class TableParser {
let row: RawTableCell[] = [];
for (let c = range.s.c; c <= range.e.c; c++) {
let C = xlsl.utils.encode_col(c);
let cell: RawTableCell = {
...(sheet[`${C}${R}`] as xlsl.CellObject),
let origin_cell = sheet[`${C}${R}`] as xlsl.CellObject;
let cell: RawTableCell = origin_cell ? {
...origin_cell,
column: c,
row: r,
};
} : null;
row.push(cell);
}
rows.push(row);
@@ -132,7 +133,6 @@ export class TableParser {
var t = this.get_data_type(cell);
if (type_order.indexOf(t) < type_order.indexOf(type)) {
if (type != DataType.null) {
// console.log(colors.yellow(`\t\t${first.v} 的数据类型被提升为 ${t}\n\t\t ${this.dump_row_values(rows[start_raw + i])}`));
console.log(colors.yellow(`\t\t${first.v}(${this.format_cell_position(first).replace(/\d+/, '')}列) 的数据类型被提升为 ${t} 因为 ${this.format_cell_position(cell)} 的值为 ${cell.w}`));
}
type = t;
@@ -269,7 +269,7 @@ export class TableParser {
}
}
protected get_cell_value(cell: xlsl.CellObject, type: DataType) {
protected get_cell_value(cell: RawTableCell, type: DataType) {
switch (type) {
case DataType.bool:
return cell && cell.v as boolean == true;