export-table-pulgin-csharp 1.0.57 → 1.0.58

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCSPlugin.d.ts","sourceRoot":"","sources":["../src/ExportCSPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAA0B,MAAM,kBAAkB,CAAA;AAI1H,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAkTpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC"}
1
+ {"version":3,"file":"ExportCSPlugin.d.ts","sourceRoot":"","sources":["../src/ExportCSPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAA0B,MAAM,kBAAkB,CAAA;AAM1H,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAoTpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC"}
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.ExportPlugin = exports.export_stuff = void 0;
27
27
  const export_table_lib_1 = require("export-table-lib");
28
28
  const fs = __importStar(require("fs-extra"));
29
+ var isSkipExportDefaults = process.argv.findIndex(v => v == "--SkipDefaults") >= 0;
29
30
  function export_stuff(paras) {
30
31
  let { datas, fields, inject, name, objects, packagename, tables, xxtea, } = paras;
31
32
  let firstLetterUpper = function (str) {
@@ -193,7 +194,9 @@ public partial class ${RowClass} {
193
194
 
194
195
  public static List<${RowClass}> Configs = new List<${RowClass}>()
195
196
  {
197
+ ${(0, export_table_lib_1.iff)(!isSkipExportDefaults, () => `
196
198
  ${(0, export_table_lib_1.foreach)(datas, data => ` new ${RowClass}(${(0, export_table_lib_1.st)(() => fields.map((f, index) => genValue(data[index], f)).join(", "))}),`)}
199
+ `)}
197
200
  };
198
201
 
199
202
  public ${RowClass}() { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "export-table-pulgin-csharp",
3
- "version": "1.0.57",
3
+ "version": "1.0.58",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -3,6 +3,8 @@ import { cmm, HandleSheetParams, Field, foreach, IPlugin, st, PluginBase, Handle
3
3
  import * as fs from "fs-extra"
4
4
  import { json } from "stream/consumers";
5
5
 
6
+ var isSkipExportDefaults = process.argv.findIndex(v => v == "--SkipDefaults") >= 0
7
+
6
8
  export function export_stuff(paras: HandleSheetParams): string | null {
7
9
  let {
8
10
  datas,
@@ -155,9 +157,11 @@ public partial class ${RowClass} {
155
157
 
156
158
  public static List<${RowClass}> Configs = new List<${RowClass}>()
157
159
  {
160
+ ${iff(!isSkipExportDefaults, () => `
158
161
  ${foreach(datas, data =>
159
- ` new ${RowClass}(${st(() => fields.map((f, index) => genValue(data[index], f)).join(", "))}),`
160
- )}
162
+ ` new ${RowClass}(${st(() => fields.map((f, index) => genValue(data[index], f)).join(", "))}),`
163
+ )}
164
+ `)}
161
165
  };
162
166
 
163
167
  public ${RowClass}() { }