phecda-core 3.0.0-alpha.4 → 3.0.0-alpha.6

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.
package/dist/index.d.ts CHANGED
@@ -30,7 +30,7 @@ declare function Ignore(proto: any, key: PropertyKey): void;
30
30
  declare function Clear(proto: any, key: PropertyKey): void;
31
31
  declare function Err<Fn extends (...args: any) => any>(cb: Fn): (proto: any, key: PropertyKey) => void;
32
32
  declare function Expose(proto: any, key: PropertyKey): void;
33
- declare function To(cb: (arg: any, instance: any, key: string) => any): (proto: any, key: PropertyKey) => void;
33
+ declare function To(...callbacks: ((arg: any, instance: any, key: string) => any)[]): (proto: any, key: PropertyKey) => void;
34
34
  declare function Tag(tag: string): (module: any) => void;
35
35
  declare function Assign(cb: (instance?: any) => any): (module: any) => void;
36
36
  declare function Global(module: any): void;
package/dist/index.js CHANGED
@@ -321,7 +321,7 @@ function Init(proto, key) {
321
321
  setVar(proto, key);
322
322
  regisHandler(proto, key, {
323
323
  async init(instance) {
324
- instance[key]();
324
+ return instance[key]();
325
325
  }
326
326
  });
327
327
  }
@@ -361,12 +361,13 @@ function Expose(proto, key) {
361
361
  setExposeKey(proto, key);
362
362
  }
363
363
  __name(Expose, "Expose");
364
- function To(cb) {
364
+ function To(...callbacks) {
365
365
  return (proto, key) => {
366
366
  setVar(proto, key);
367
367
  regisHandler(proto, key, {
368
368
  async pipe(instance) {
369
- instance[key] = await cb(instance[key], instance, key);
369
+ for (const cb of callbacks)
370
+ instance[key] = await cb(instance[key], instance, key);
370
371
  }
371
372
  });
372
373
  };
package/dist/index.mjs CHANGED
@@ -249,7 +249,7 @@ function Init(proto, key) {
249
249
  setVar(proto, key);
250
250
  regisHandler(proto, key, {
251
251
  async init(instance) {
252
- instance[key]();
252
+ return instance[key]();
253
253
  }
254
254
  });
255
255
  }
@@ -289,12 +289,13 @@ function Expose(proto, key) {
289
289
  setExposeKey(proto, key);
290
290
  }
291
291
  __name(Expose, "Expose");
292
- function To(cb) {
292
+ function To(...callbacks) {
293
293
  return (proto, key) => {
294
294
  setVar(proto, key);
295
295
  regisHandler(proto, key, {
296
296
  async pipe(instance) {
297
- instance[key] = await cb(instance[key], instance, key);
297
+ for (const cb of callbacks)
298
+ instance[key] = await cb(instance[key], instance, key);
298
299
  }
299
300
  });
300
301
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-core",
3
- "version": "3.0.0-alpha.4",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "provide base function and abstract limit to other phecda module ",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",