@zwa73/utils 1.0.72 → 1.0.73

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.
@@ -207,10 +207,12 @@ var UtilFunc;
207
207
  */
208
208
  function composeClassPart(base, mixin, key, ...fields) {
209
209
  const compObj = base;
210
+ if (compObj[key] !== undefined)
211
+ UtilLogger_1.SLogger.warn(`key: ${key} 已存在于基础类中, 混入可能导致类型问题`);
210
212
  compObj[key] = mixin;
211
213
  for (const fd of fields) {
212
214
  if (compObj[fd] !== undefined)
213
- UtilLogger_1.SLogger.warn(`${fd} 已存在于基础类中, 混入可能导致类型问题, 如需覆盖, 请使用 ${key}=val`);
215
+ UtilLogger_1.SLogger.warn(`field: ${fd} 已存在于基础类中, 混入可能导致类型问题, 如需覆盖, 请使用 ${key}=val`);
214
216
  Object.defineProperty(compObj, fd, {
215
217
  get: () => compObj[key][fd],
216
218
  set: (value) => { compObj[key][fd] = value; },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -225,10 +225,12 @@ export function composeClassPart
225
225
  <Base extends object,Mixin extends object,Field extends keyof Mixin>
226
226
  (base:Base,mixin:Mixin,key:string,...fields:Field[]):ComposedClass<Base,Mixin,typeof key,Field>{
227
227
  const compObj = base as any;
228
+ if(compObj[key]!==undefined)
229
+ SLogger.warn(`key: ${key as string} 已存在于基础类中, 混入可能导致类型问题`);
228
230
  compObj[key] = mixin;
229
231
  for(const fd of fields){
230
232
  if(compObj[fd]!==undefined)
231
- SLogger.warn(`${fd as string} 已存在于基础类中, 混入可能导致类型问题, 如需覆盖, 请使用 ${key}=val`);
233
+ SLogger.warn(`field: ${fd as string} 已存在于基础类中, 混入可能导致类型问题, 如需覆盖, 请使用 ${key}=val`);
232
234
  Object.defineProperty(compObj, fd, {
233
235
  get: ()=>compObj[key][fd],
234
236
  set: (value)=>{compObj[key][fd] = value},