@zwa73/utils 1.0.73 → 1.0.74

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.
@@ -213,26 +213,27 @@ var UtilFunc;
213
213
  for (const fd of fields) {
214
214
  if (compObj[fd] !== undefined)
215
215
  UtilLogger_1.SLogger.warn(`field: ${fd} 已存在于基础类中, 混入可能导致类型问题, 如需覆盖, 请使用 ${key}=val`);
216
- Object.defineProperty(compObj, fd, {
217
- get: () => compObj[key][fd],
218
- set: (value) => { compObj[key][fd] = value; },
219
- enumerable: true,
220
- //writable: true ,
221
- configurable: true
222
- });
223
- //if(typeof mixin[fd] === 'function') {
224
- // compObj[fd] = (...args: any[]) => compObj[key][fd](...args);
225
- // //(compObj as any)[fd] = (...args: any[]) => (mixin[fd] as any).apply(mixin, args);
226
- // //(compObj as any)[fd] = (mixin[fd] as any).bind(mixin);
227
- //} else {
228
- // Object.defineProperty(compObj, fd, {
229
- // get: ()=>compObj[key][fd],
230
- // set: (value)=>{compObj[key][fd] = value},
231
- // enumerable:true ,
232
- // //writable: true ,
233
- // configurable: true
234
- // });
235
- //}
216
+ //Object.defineProperty(compObj, fd, {
217
+ // get: ()=>compObj[key][fd],
218
+ // set: (value)=>{compObj[key][fd] = value},
219
+ // enumerable:true ,
220
+ // //writable: true ,
221
+ // configurable: true
222
+ //});
223
+ if (typeof mixin[fd] === 'function') {
224
+ compObj[fd] = (...args) => compObj[key][fd](...args);
225
+ //(compObj as any)[fd] = (...args: any[]) => (mixin[fd] as any).apply(mixin, args);
226
+ //(compObj as any)[fd] = (mixin[fd] as any).bind(mixin);
227
+ }
228
+ else {
229
+ Object.defineProperty(compObj, fd, {
230
+ get: () => compObj[key][fd],
231
+ set: (value) => { compObj[key][fd] = value; },
232
+ enumerable: true,
233
+ //writable: true ,
234
+ configurable: true
235
+ });
236
+ }
236
237
  }
237
238
  return compObj;
238
239
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.73",
3
+ "version": "1.0.74",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -231,26 +231,26 @@ export function composeClassPart
231
231
  for(const fd of fields){
232
232
  if(compObj[fd]!==undefined)
233
233
  SLogger.warn(`field: ${fd as string} 已存在于基础类中, 混入可能导致类型问题, 如需覆盖, 请使用 ${key}=val`);
234
- Object.defineProperty(compObj, fd, {
235
- get: ()=>compObj[key][fd],
236
- set: (value)=>{compObj[key][fd] = value},
237
- enumerable:true ,
238
- //writable: true ,
239
- configurable: true
240
- });
241
- //if(typeof mixin[fd] === 'function') {
242
- // compObj[fd] = (...args: any[]) => compObj[key][fd](...args);
243
- // //(compObj as any)[fd] = (...args: any[]) => (mixin[fd] as any).apply(mixin, args);
244
- // //(compObj as any)[fd] = (mixin[fd] as any).bind(mixin);
245
- //} else {
246
- // Object.defineProperty(compObj, fd, {
247
- // get: ()=>compObj[key][fd],
248
- // set: (value)=>{compObj[key][fd] = value},
249
- // enumerable:true ,
250
- // //writable: true ,
251
- // configurable: true
252
- // });
253
- //}
234
+ //Object.defineProperty(compObj, fd, {
235
+ // get: ()=>compObj[key][fd],
236
+ // set: (value)=>{compObj[key][fd] = value},
237
+ // enumerable:true ,
238
+ // //writable: true ,
239
+ // configurable: true
240
+ //});
241
+ if(typeof mixin[fd] === 'function') {
242
+ compObj[fd] = (...args: any[]) => compObj[key][fd](...args);
243
+ //(compObj as any)[fd] = (...args: any[]) => (mixin[fd] as any).apply(mixin, args);
244
+ //(compObj as any)[fd] = (mixin[fd] as any).bind(mixin);
245
+ } else {
246
+ Object.defineProperty(compObj, fd, {
247
+ get: ()=>compObj[key][fd],
248
+ set: (value)=>{compObj[key][fd] = value},
249
+ enumerable:true ,
250
+ //writable: true ,
251
+ configurable: true
252
+ });
253
+ }
254
254
  }
255
255
  return compObj;
256
256
  }