export-table-pulgin-csharp 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "export-table-pulgin-csharp",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -62,7 +62,8 @@ export function export_stuff(paras: HandleSheetParams): string | null {
62
62
  return t;
63
63
  }
64
64
 
65
- const genValue = (value: any, t: string): string => {
65
+ const genValue = (value: any, f: Field): string => {
66
+ let t = f.type
66
67
  if (t == "object") {
67
68
  throw new Error("invalid type <object>")
68
69
  } else if (t == "object[]") {
@@ -114,7 +115,7 @@ public class ${RowClass} {
114
115
  public static List<${RowClass}> Configs = new List<${RowClass}>()
115
116
  {
116
117
  ${foreach(datas, data =>
117
- ` new ${RowClass}(${st(() => fields.map((f, index) => genValue(data[index], f.type)).join(", "))}),`
118
+ ` new ${RowClass}(${st(() => fields.map((f, index) => genValue(data[index], f)).join(", "))}),`
118
119
  )}
119
120
  };
120
121