plutin 1.8.7 → 1.8.8
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.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -495,6 +495,10 @@ var DependencyContainer = class {
|
|
|
495
495
|
}
|
|
496
496
|
static registry = /* @__PURE__ */ new Map();
|
|
497
497
|
static singletons = /* @__PURE__ */ new Map();
|
|
498
|
+
static reset() {
|
|
499
|
+
this.registry.clear();
|
|
500
|
+
this.singletons.clear();
|
|
501
|
+
}
|
|
498
502
|
static register(token, myClass, options) {
|
|
499
503
|
this.registry.set(token, {
|
|
500
504
|
type: "class",
|
|
@@ -510,7 +514,8 @@ var DependencyContainer = class {
|
|
|
510
514
|
}
|
|
511
515
|
static resolve(target) {
|
|
512
516
|
const injectMetadata = Reflect.getOwnMetadata("inject:params", target) || {};
|
|
513
|
-
const
|
|
517
|
+
const designParamTypes = Reflect.getMetadata("design:paramtypes", target) || [];
|
|
518
|
+
const paramCount = Math.max(designParamTypes.length, Object.keys(injectMetadata).length);
|
|
514
519
|
const params = Array.from({
|
|
515
520
|
length: paramCount
|
|
516
521
|
}, (_, index) => {
|