export-table-plugin-typescript 1.0.19 → 1.0.21

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":"ExportTS.d.ts","sourceRoot":"","sources":["../src/ExportTS.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAmF,MAAM,kBAAkB,CAAA;AAGnL,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA2OpE;AAED,qBAAa,cAAe,SAAQ,UAAU;IAC7C,IAAI,SAAe;IACnB,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAQpC"}
1
+ {"version":3,"file":"ExportTS.d.ts","sourceRoot":"","sources":["../src/ExportTS.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAAmF,MAAM,kBAAkB,CAAA;AAGnL,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAkQpE;AAED,qBAAa,cAAe,SAAQ,UAAU;IAC7C,IAAI,SAAe;IACnB,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAQpC"}
package/dist/ExportTS.js CHANGED
@@ -168,7 +168,7 @@ ${(0, export_table_lib_1.foreach)(fields, f => `
168
168
  ]
169
169
 
170
170
  export class ${RowClass}{
171
-
171
+
172
172
  ${(0, export_table_lib_1.foreach)(fields, f => `
173
173
  /**
174
174
  * ${f.describe}
@@ -227,7 +227,30 @@ export class ${ClassName} {
227
227
  public static readonly I = new ${ClassName}();
228
228
 
229
229
  readonly Configs: ${RowClass}[] = [];
230
+ get Head(){
231
+ return this.Configs[0]
232
+ }
230
233
 
234
+ ${(0, export_table_lib_1.foreach)(fields, f => `
235
+ private _findBy${getFieldName(f.name)}CacheMap: Map<${f.type}, ${RowClass}> = new Map()
236
+ FindConfigBy${getFieldName(f.name)}(${f.name}: ${f.type}): ${RowClass} | undefined {
237
+ let cacheMap = this._findBy${getFieldName(f.name)}CacheMap
238
+ if (cacheMap.has(${f.name})) {
239
+ return cacheMap.get(${f.name})
240
+ } else {
241
+ let configs = this.Configs
242
+ let index = configs.findIndex(c => c.${f.name} == ${f.name})
243
+ if (index != -1) {
244
+ let config = configs[index]
245
+ cacheMap.set(${f.name}, config)
246
+ return config
247
+ } else {
248
+ cacheMap.set(${f.name}, undefined)
249
+ return undefined
250
+ }
251
+ }
252
+ }
253
+ `)}
231
254
  protected LoadDefaultConfigs() {
232
255
 
233
256
  let configs = this.Configs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "export-table-plugin-typescript",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
package/src/ExportTS.ts CHANGED
@@ -132,7 +132,7 @@ ${foreach(fields, f => `
132
132
  ]
133
133
 
134
134
  export class ${RowClass}{
135
-
135
+
136
136
  ${foreach(fields, f => `
137
137
  /**
138
138
  * ${f.describe}
@@ -191,7 +191,30 @@ export class ${ClassName} {
191
191
  public static readonly I = new ${ClassName}();
192
192
 
193
193
  readonly Configs: ${RowClass}[] = [];
194
+ get Head(){
195
+ return this.Configs[0]
196
+ }
194
197
 
198
+ ${foreach(fields, f => `
199
+ private _findBy${getFieldName(f.name)}CacheMap: Map<${f.type}, ${RowClass}> = new Map()
200
+ FindConfigBy${getFieldName(f.name)}(${f.name}: ${f.type}): ${RowClass} | undefined {
201
+ let cacheMap = this._findBy${getFieldName(f.name)}CacheMap
202
+ if (cacheMap.has(${f.name})) {
203
+ return cacheMap.get(${f.name})
204
+ } else {
205
+ let configs = this.Configs
206
+ let index = configs.findIndex(c => c.${f.name} == ${f.name})
207
+ if (index != -1) {
208
+ let config = configs[index]
209
+ cacheMap.set(${f.name}, config)
210
+ return config
211
+ } else {
212
+ cacheMap.set(${f.name}, undefined)
213
+ return undefined
214
+ }
215
+ }
216
+ }
217
+ `)}
195
218
  protected LoadDefaultConfigs() {
196
219
 
197
220
  let configs = this.Configs