@inversifyjs/core 3.0.2 → 3.2.0
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/CHANGELOG.md +27 -0
- package/lib/cjs/common/models/OneToManyMapStar.d.ts.map +1 -1
- package/lib/cjs/common/models/OneToManyMapStar.js +15 -14
- package/lib/cjs/common/models/OneToManyMapStar.js.map +1 -1
- package/lib/cjs/decorator/calculations/getDecoratorInfo.d.ts +1 -0
- package/lib/cjs/decorator/calculations/getDecoratorInfo.d.ts.map +1 -1
- package/lib/cjs/decorator/calculations/getDecoratorInfo.js +12 -4
- package/lib/cjs/decorator/calculations/getDecoratorInfo.js.map +1 -1
- package/lib/cjs/decorator/calculations/stringifyDecoratorInfo.d.ts.map +1 -1
- package/lib/cjs/decorator/calculations/stringifyDecoratorInfo.js +2 -0
- package/lib/cjs/decorator/calculations/stringifyDecoratorInfo.js.map +1 -1
- package/lib/cjs/decorator/models/DecoratorInfo.d.ts +2 -1
- package/lib/cjs/decorator/models/DecoratorInfo.d.ts.map +1 -1
- package/lib/cjs/decorator/models/DecoratorInfoKind.d.ts +3 -2
- package/lib/cjs/decorator/models/DecoratorInfoKind.d.ts.map +1 -1
- package/lib/cjs/decorator/models/DecoratorInfoKind.js +3 -2
- package/lib/cjs/decorator/models/DecoratorInfoKind.js.map +1 -1
- package/lib/cjs/decorator/models/MethodDecoratorInfo.d.ts +6 -0
- package/lib/cjs/decorator/models/MethodDecoratorInfo.d.ts.map +1 -0
- package/lib/cjs/decorator/models/MethodDecoratorInfo.js +3 -0
- package/lib/cjs/decorator/models/MethodDecoratorInfo.js.map +1 -0
- package/lib/cjs/metadata/calculations/getExtendedConstructorArguments.js +1 -1
- package/lib/cjs/metadata/calculations/getExtendedConstructorArguments.js.map +1 -1
- package/lib/cjs/metadata/calculations/getExtendedProperties.js +1 -1
- package/lib/cjs/metadata/calculations/getExtendedProperties.js.map +1 -1
- package/lib/cjs/metadata/calculations/handleInjectionError.d.ts +1 -1
- package/lib/cjs/metadata/calculations/handleInjectionError.d.ts.map +1 -1
- package/lib/cjs/metadata/calculations/handleInjectionError.js.map +1 -1
- package/lib/cjs/metadata/decorators/inject.d.ts +1 -1
- package/lib/cjs/metadata/decorators/inject.d.ts.map +1 -1
- package/lib/cjs/metadata/decorators/inject.js +1 -14
- package/lib/cjs/metadata/decorators/inject.js.map +1 -1
- package/lib/cjs/metadata/decorators/injectBase.d.ts +2 -1
- package/lib/cjs/metadata/decorators/injectBase.d.ts.map +1 -1
- package/lib/cjs/metadata/decorators/injectBase.js +34 -6
- package/lib/cjs/metadata/decorators/injectBase.js.map +1 -1
- package/lib/cjs/metadata/decorators/multiInject.d.ts +1 -1
- package/lib/cjs/metadata/decorators/multiInject.d.ts.map +1 -1
- package/lib/cjs/metadata/decorators/multiInject.js +1 -14
- package/lib/cjs/metadata/decorators/multiInject.js.map +1 -1
- package/lib/cjs/metadata/decorators/named.d.ts +1 -1
- package/lib/cjs/metadata/decorators/named.d.ts.map +1 -1
- package/lib/cjs/metadata/decorators/named.js +1 -14
- package/lib/cjs/metadata/decorators/named.js.map +1 -1
- package/lib/cjs/metadata/decorators/optional.d.ts +1 -1
- package/lib/cjs/metadata/decorators/optional.d.ts.map +1 -1
- package/lib/cjs/metadata/decorators/optional.js +1 -14
- package/lib/cjs/metadata/decorators/optional.js.map +1 -1
- package/lib/cjs/metadata/decorators/tagged.d.ts +1 -1
- package/lib/cjs/metadata/decorators/tagged.d.ts.map +1 -1
- package/lib/cjs/metadata/decorators/tagged.js +1 -14
- package/lib/cjs/metadata/decorators/tagged.js.map +1 -1
- package/lib/cjs/metadata/decorators/unmanaged.d.ts +1 -1
- package/lib/cjs/metadata/decorators/unmanaged.d.ts.map +1 -1
- package/lib/cjs/metadata/decorators/unmanaged.js +1 -14
- package/lib/cjs/metadata/decorators/unmanaged.js.map +1 -1
- package/lib/cjs/planning/calculations/buildFilteredServiceBindings.d.ts +2 -3
- package/lib/cjs/planning/calculations/buildFilteredServiceBindings.d.ts.map +1 -1
- package/lib/cjs/planning/calculations/buildFilteredServiceBindings.js +1 -3
- package/lib/cjs/planning/calculations/buildFilteredServiceBindings.js.map +1 -1
- package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.d.ts +2 -1
- package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.d.ts.map +1 -1
- package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.js +3 -3
- package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.js.map +1 -1
- package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.d.ts +2 -1
- package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.d.ts.map +1 -1
- package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.js +3 -3
- package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.js.map +1 -1
- package/lib/cjs/planning/calculations/plan.d.ts.map +1 -1
- package/lib/cjs/planning/calculations/plan.js +9 -5
- package/lib/cjs/planning/calculations/plan.js.map +1 -1
- package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.d.ts +2 -1
- package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.d.ts.map +1 -1
- package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.js +24 -10
- package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.js.map +1 -1
- package/lib/esm/index.d.ts +6 -6
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @inversifyjs/core
|
|
2
2
|
|
|
3
|
+
## 3.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7743276: Updated plan related error messages with binding metadata details
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 7572767: Updated `OneToManyMapStar.clone` to properly clone map array values
|
|
12
|
+
- 9621865: Updated `injectBase` default values to be true
|
|
13
|
+
- 559efd8: Updated `BindToFluentSyntaxImplementation.toDynamicValue` with right default scope
|
|
14
|
+
|
|
15
|
+
## 3.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 1c93440: Updated `unmanaged` to support method decoration
|
|
20
|
+
- 1c93440: Updated `inject` to support method decoration
|
|
21
|
+
- 1c93440: Updated `optional` to support method decoration
|
|
22
|
+
- 1c93440: Updated `named` to support method decoration
|
|
23
|
+
- 1c93440: Updated `tagged` to support method decoration
|
|
24
|
+
- 1c93440: Updated `multiInject` to support method decoration
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- c80459d: Updated `OneToManyMapStar` to fix an issue involving a deletion use case
|
|
29
|
+
|
|
3
30
|
## 3.0.2
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneToManyMapStar.d.ts","sourceRoot":"","sources":["../../../../src/common/models/OneToManyMapStar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,MAAM,qBAAqB,CAAC,SAAS,SAAS,MAAM,IAAI;KAC3D,IAAI,IAAI,MAAM,SAAS,GAAG;QACzB,UAAU,EAAE,SAAS,SAAS,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;KAC9D;CACF,CAAC;AAMF;;GAEG;AACH,qBAAa,gBAAgB,CAAC,MAAM,EAAE,SAAS,SAAS,MAAM,CAC5D,YAAW,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;;gBAM7C,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAY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B5C,GAAG,CAAC,IAAI,SAAS,MAAM,SAAS,EACrC,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAC/B,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS;IAIxB,UAAU,CAAC,IAAI,SAAS,MAAM,SAAS,EAC5C,GAAG,EAAE,IAAI,GACR,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAIrB,gBAAgB,CAAC,IAAI,SAAS,MAAM,SAAS,EAClD,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAC/B,IAAI;CAiGR"}
|
|
@@ -20,7 +20,7 @@ class OneToManyMapStar {
|
|
|
20
20
|
add(model, relation) {
|
|
21
21
|
this.#buildOrGetModelArray(model).push(relation);
|
|
22
22
|
for (const relationKey of Reflect.ownKeys(relation)) {
|
|
23
|
-
this.#
|
|
23
|
+
this.#buildOrGetRelationModels(relationKey, relation[relationKey]).push(model);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
clone() {
|
|
@@ -43,7 +43,8 @@ class OneToManyMapStar {
|
|
|
43
43
|
if (models === undefined) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
const uniqueModelsSet = new Set(models);
|
|
47
|
+
for (const model of uniqueModelsSet) {
|
|
47
48
|
const relations = this.#modelToRelationMap.get(model);
|
|
48
49
|
if (relations === undefined) {
|
|
49
50
|
throw new Error('Expecting model relation, none found');
|
|
@@ -64,17 +65,17 @@ class OneToManyMapStar {
|
|
|
64
65
|
}
|
|
65
66
|
return relations;
|
|
66
67
|
}
|
|
67
|
-
#
|
|
68
|
-
let
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
this.#relationToModelsMaps[relationKey].set(relationValue,
|
|
68
|
+
#buildOrGetRelationModels(relationKey, relationValue) {
|
|
69
|
+
let models = this.#relationToModelsMaps[relationKey].get(relationValue);
|
|
70
|
+
if (models === undefined) {
|
|
71
|
+
models = [];
|
|
72
|
+
this.#relationToModelsMaps[relationKey].set(relationValue, models);
|
|
72
73
|
}
|
|
73
|
-
return
|
|
74
|
+
return models;
|
|
74
75
|
}
|
|
75
76
|
#pushEntriesIntoMap(source, target) {
|
|
76
77
|
for (const [key, value] of source) {
|
|
77
|
-
target.set(key, value);
|
|
78
|
+
target.set(key, [...value]);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
#removeModelFromRelationMaps(model, relation) {
|
|
@@ -83,13 +84,13 @@ class OneToManyMapStar {
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
#removeModelFromRelationMap(model, relationKey, relationValue) {
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
const index =
|
|
87
|
+
const relationModels = this.#relationToModelsMaps[relationKey].get(relationValue);
|
|
88
|
+
if (relationModels !== undefined) {
|
|
89
|
+
const index = relationModels.indexOf(model);
|
|
89
90
|
if (index !== NOT_FOUND_INDEX) {
|
|
90
|
-
|
|
91
|
+
relationModels.splice(index, 1);
|
|
91
92
|
}
|
|
92
|
-
if (
|
|
93
|
+
if (relationModels.length === 0) {
|
|
93
94
|
this.#relationToModelsMaps[relationKey].delete(relationValue);
|
|
94
95
|
}
|
|
95
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneToManyMapStar.js","sourceRoot":"","sources":["../../../../src/common/models/OneToManyMapStar.ts"],"names":[],"mappings":";;;AAEA,MAAM,eAAe,GAAW,CAAC,CAAC,CAAC;AAYnC;;GAEG;AACH,MAAa,gBAAgB;IAGlB,mBAAmB,CAA2B;IAC9C,qBAAqB,CAAwC;IAC7D,KAAK,CAAmC;IAEjD,YAAY,IAAsC;QAChD,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;QAErC,IAAI,CAAC,qBAAqB,GAAG,EAA2C,CAAC;QAEzE,KAAK,MAAM,YAAY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ED,4BAA4B,CAAC,KAAa,EAAE,QAAmB;QAC7D,KAAK,MAAM,WAAW,IAAI,OAAO,CAAC,OAAO,CACvC,QAAQ,CACc,EAAE,CAAC;YACzB,IAAI,CAAC,2BAA2B,CAC9B,KAAK,EACL,WAAW,EACX,QAAQ,CAAC,WAAW,CAAC,CACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,2BAA2B,CACzB,KAAa,EACb,WAAiB,EACjB,aAA8B;QAE9B,MAAM,cAAc,GAClB,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAE7D,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,KAAK,GAAW,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAEpD,IAAI,KAAK,KAAK,eAAe,EAAE,CAAC;gBAC9B,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAClC,CAAC;YAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAChC,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAxKD,4CAwKC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DecoratorInfo } from '../models/DecoratorInfo';
|
|
2
2
|
export declare function getDecoratorInfo(target: object, propertyKey: undefined, parameterIndex: number): DecoratorInfo;
|
|
3
|
+
export declare function getDecoratorInfo<T>(target: object, propertyKey: string | symbol | undefined, descriptor: number | TypedPropertyDescriptor<T> | undefined): DecoratorInfo;
|
|
3
4
|
export declare function getDecoratorInfo(target: object, propertyKey: string | symbol): DecoratorInfo;
|
|
4
5
|
export declare function getDecoratorInfo(target: object, propertyKey: string | symbol | undefined, parameterIndex?: number | undefined): DecoratorInfo;
|
|
5
6
|
//# sourceMappingURL=getDecoratorInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/calculations/getDecoratorInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,EACtB,cAAc,EAAE,MAAM,GACrB,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAClC,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"getDecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/calculations/getDecoratorInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,EACtB,cAAc,EAAE,MAAM,GACrB,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,UAAU,EAAE,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,GAC1D,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAClC,aAAa,CAAC"}
|
|
@@ -4,8 +4,8 @@ exports.getDecoratorInfo = getDecoratorInfo;
|
|
|
4
4
|
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
|
|
5
5
|
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
|
|
6
6
|
const DecoratorInfoKind_1 = require("../models/DecoratorInfoKind");
|
|
7
|
-
function getDecoratorInfo(target, propertyKey,
|
|
8
|
-
if (
|
|
7
|
+
function getDecoratorInfo(target, propertyKey, parameterIndexOrDescriptor) {
|
|
8
|
+
if (parameterIndexOrDescriptor === undefined) {
|
|
9
9
|
if (propertyKey === undefined) {
|
|
10
10
|
throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.unknown, 'Unexpected undefined property and index values');
|
|
11
11
|
}
|
|
@@ -15,9 +15,17 @@ function getDecoratorInfo(target, propertyKey, parameterIndex) {
|
|
|
15
15
|
targetClass: target.constructor,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
if (typeof parameterIndexOrDescriptor === 'number') {
|
|
19
|
+
return {
|
|
20
|
+
index: parameterIndexOrDescriptor,
|
|
21
|
+
kind: DecoratorInfoKind_1.DecoratorInfoKind.parameter,
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
23
|
+
targetClass: target,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
18
26
|
return {
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
kind: DecoratorInfoKind_1.DecoratorInfoKind.method,
|
|
28
|
+
method: propertyKey,
|
|
21
29
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
22
30
|
targetClass: target,
|
|
23
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDecoratorInfo.js","sourceRoot":"","sources":["../../../../src/decorator/calculations/getDecoratorInfo.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getDecoratorInfo.js","sourceRoot":"","sources":["../../../../src/decorator/calculations/getDecoratorInfo.ts"],"names":[],"mappings":";;AAwBA,4CAmCC;AA3DD,8EAA2E;AAC3E,sFAAmF;AAEnF,mEAAgE;AAqBhE,SAAgB,gBAAgB,CAC9B,MAAc,EACd,WAAwC,EACxC,0BAA4E;IAE5E,IAAI,0BAA0B,KAAK,SAAS,EAAE,CAAC;QAC7C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,uCAAkB,CAC1B,+CAAsB,CAAC,OAAO,EAC9B,gDAAgD,CACjD,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,qCAAiB,CAAC,QAAQ;YAChC,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE,CAAC;QACnD,OAAO;YACL,KAAK,EAAE,0BAA0B;YACjC,IAAI,EAAE,qCAAiB,CAAC,SAAS;YACjC,sEAAsE;YACtE,WAAW,EAAE,MAAkB;SAChC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,qCAAiB,CAAC,MAAM;QAC9B,MAAM,EAAE,WAA8B;QACtC,sEAAsE;QACtE,WAAW,EAAE,MAAkB;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringifyDecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/calculations/stringifyDecoratorInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,aAAa,GACjC,MAAM,
|
|
1
|
+
{"version":3,"file":"stringifyDecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/calculations/stringifyDecoratorInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,aAAa,GACjC,MAAM,CASR"}
|
|
@@ -4,6 +4,8 @@ exports.stringifyDecoratorInfo = stringifyDecoratorInfo;
|
|
|
4
4
|
const DecoratorInfoKind_1 = require("../models/DecoratorInfoKind");
|
|
5
5
|
function stringifyDecoratorInfo(decoratorTargetInfo) {
|
|
6
6
|
switch (decoratorTargetInfo.kind) {
|
|
7
|
+
case DecoratorInfoKind_1.DecoratorInfoKind.method:
|
|
8
|
+
return `[class: "${decoratorTargetInfo.targetClass.name}", method: "${decoratorTargetInfo.method.toString()}"]`;
|
|
7
9
|
case DecoratorInfoKind_1.DecoratorInfoKind.parameter:
|
|
8
10
|
return `[class: "${decoratorTargetInfo.targetClass.name}", index: "${decoratorTargetInfo.index.toString()}"]`;
|
|
9
11
|
case DecoratorInfoKind_1.DecoratorInfoKind.property:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringifyDecoratorInfo.js","sourceRoot":"","sources":["../../../../src/decorator/calculations/stringifyDecoratorInfo.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"stringifyDecoratorInfo.js","sourceRoot":"","sources":["../../../../src/decorator/calculations/stringifyDecoratorInfo.ts"],"names":[],"mappings":";;AAGA,wDAWC;AAbD,mEAAgE;AAEhE,SAAgB,sBAAsB,CACpC,mBAAkC;IAElC,QAAQ,mBAAmB,CAAC,IAAI,EAAE,CAAC;QACjC,KAAK,qCAAiB,CAAC,MAAM;YAC3B,OAAO,YAAY,mBAAmB,CAAC,WAAW,CAAC,IAAI,eAAe,mBAAmB,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC;QAClH,KAAK,qCAAiB,CAAC,SAAS;YAC9B,OAAO,YAAY,mBAAmB,CAAC,WAAW,CAAC,IAAI,cAAc,mBAAmB,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChH,KAAK,qCAAiB,CAAC,QAAQ;YAC7B,OAAO,YAAY,mBAAmB,CAAC,WAAW,CAAC,IAAI,iBAAiB,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxH,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { MethodDecoratorInfo } from './MethodDecoratorInfo';
|
|
1
2
|
import { ParameterDecoratorInfo } from './ParameterDecoratorInfo';
|
|
2
3
|
import { PropertyDecoratorInfo } from './PropertyDecoratorInfo';
|
|
3
|
-
export type DecoratorInfo = ParameterDecoratorInfo | PropertyDecoratorInfo;
|
|
4
|
+
export type DecoratorInfo = MethodDecoratorInfo | ParameterDecoratorInfo | PropertyDecoratorInfo;
|
|
4
5
|
//# sourceMappingURL=DecoratorInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/models/DecoratorInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"DecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/models/DecoratorInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoratorInfoKind.d.ts","sourceRoot":"","sources":["../../../../src/decorator/models/DecoratorInfoKind.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,SAAS,IAAA;IACT,QAAQ,IAAA;CACT"}
|
|
1
|
+
{"version":3,"file":"DecoratorInfoKind.d.ts","sourceRoot":"","sources":["../../../../src/decorator/models/DecoratorInfoKind.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,MAAM,IAAA;IACN,SAAS,IAAA;IACT,QAAQ,IAAA;CACT"}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DecoratorInfoKind = void 0;
|
|
4
4
|
var DecoratorInfoKind;
|
|
5
5
|
(function (DecoratorInfoKind) {
|
|
6
|
-
DecoratorInfoKind[DecoratorInfoKind["
|
|
7
|
-
DecoratorInfoKind[DecoratorInfoKind["
|
|
6
|
+
DecoratorInfoKind[DecoratorInfoKind["method"] = 0] = "method";
|
|
7
|
+
DecoratorInfoKind[DecoratorInfoKind["parameter"] = 1] = "parameter";
|
|
8
|
+
DecoratorInfoKind[DecoratorInfoKind["property"] = 2] = "property";
|
|
8
9
|
})(DecoratorInfoKind || (exports.DecoratorInfoKind = DecoratorInfoKind = {}));
|
|
9
10
|
//# sourceMappingURL=DecoratorInfoKind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoratorInfoKind.js","sourceRoot":"","sources":["../../../../src/decorator/models/DecoratorInfoKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"DecoratorInfoKind.js","sourceRoot":"","sources":["../../../../src/decorator/models/DecoratorInfoKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6DAAM,CAAA;IACN,mEAAS,CAAA;IACT,iEAAQ,CAAA;AACV,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseDecoratorInfo } from './BaseDecoratorInfo';
|
|
2
|
+
import { DecoratorInfoKind } from './DecoratorInfoKind';
|
|
3
|
+
export interface MethodDecoratorInfo extends BaseDecoratorInfo<DecoratorInfoKind.method> {
|
|
4
|
+
method: string | symbol;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=MethodDecoratorInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MethodDecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/models/MethodDecoratorInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,mBACf,SAAQ,iBAAiB,CAAC,iBAAiB,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MethodDecoratorInfo.js","sourceRoot":"","sources":["../../../../src/decorator/models/MethodDecoratorInfo.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExtendedConstructorArguments = getExtendedConstructorArguments;
|
|
4
4
|
function getExtendedConstructorArguments(options, baseTypeClassMetadata, typeMetadata) {
|
|
5
|
-
const extendConstructorArguments = options.extendConstructorArguments ??
|
|
5
|
+
const extendConstructorArguments = options.extendConstructorArguments ?? true;
|
|
6
6
|
let extendedConstructorArguments;
|
|
7
7
|
if (extendConstructorArguments) {
|
|
8
8
|
extendedConstructorArguments = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExtendedConstructorArguments.js","sourceRoot":"","sources":["../../../../src/metadata/calculations/getExtendedConstructorArguments.ts"],"names":[],"mappings":";;AAIA,0EAyBC;AAzBD,SAAgB,+BAA+B,CAC7C,OAA0B,EAC1B,qBAAoC,EACpC,YAA2B;IAE3B,MAAM,0BAA0B,GAC9B,OAAO,CAAC,0BAA0B,IAAI,
|
|
1
|
+
{"version":3,"file":"getExtendedConstructorArguments.js","sourceRoot":"","sources":["../../../../src/metadata/calculations/getExtendedConstructorArguments.ts"],"names":[],"mappings":";;AAIA,0EAyBC;AAzBD,SAAgB,+BAA+B,CAC7C,OAA0B,EAC1B,qBAAoC,EACpC,YAA2B;IAE3B,MAAM,0BAA0B,GAC9B,OAAO,CAAC,0BAA0B,IAAI,IAAI,CAAC;IAE7C,IAAI,4BAAoD,CAAC;IAEzD,IAAI,0BAA0B,EAAE,CAAC;QAC/B,4BAA4B,GAAG;YAC7B,GAAG,qBAAqB,CAAC,oBAAoB;SAC9C,CAAC;QAEF,YAAY,CAAC,oBAAoB,CAAC,GAAG,CACnC,CAAC,oBAA0C,EAAE,KAAa,EAAE,EAAE;YAC5D,4BAA4B,CAAC,KAAK,CAAC,GAAG,oBAAoB,CAAC;QAC7D,CAAC,CACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,4BAA4B,GAAG,YAAY,CAAC,oBAAoB,CAAC;IACnE,CAAC;IAED,OAAO,4BAA4B,CAAC;AACtC,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getExtendedProperties = getExtendedProperties;
|
|
4
4
|
const chain_1 = require("../../common/calculations/chain");
|
|
5
5
|
function getExtendedProperties(options, baseTypeClassMetadata, typeMetadata) {
|
|
6
|
-
const extendProperties = options.extendProperties ??
|
|
6
|
+
const extendProperties = options.extendProperties ?? true;
|
|
7
7
|
let extendedProperties;
|
|
8
8
|
if (extendProperties) {
|
|
9
9
|
extendedProperties = new Map((0, chain_1.chain)(baseTypeClassMetadata.properties, typeMetadata.properties));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExtendedProperties.js","sourceRoot":"","sources":["../../../../src/metadata/calculations/getExtendedProperties.ts"],"names":[],"mappings":";;AAKA,sDAkBC;AAvBD,2DAAwD;AAKxD,SAAgB,qBAAqB,CACnC,OAA0B,EAC1B,qBAAoC,EACpC,YAA2B;IAE3B,MAAM,gBAAgB,GAAY,OAAO,CAAC,gBAAgB,IAAI,
|
|
1
|
+
{"version":3,"file":"getExtendedProperties.js","sourceRoot":"","sources":["../../../../src/metadata/calculations/getExtendedProperties.ts"],"names":[],"mappings":";;AAKA,sDAkBC;AAvBD,2DAAwD;AAKxD,SAAgB,qBAAqB,CACnC,OAA0B,EAC1B,qBAAoC,EACpC,YAA2B;IAE3B,MAAM,gBAAgB,GAAY,OAAO,CAAC,gBAAgB,IAAI,IAAI,CAAC;IAEnE,IAAI,kBAA8D,CAAC;IAEnE,IAAI,gBAAgB,EAAE,CAAC;QACrB,kBAAkB,GAAG,IAAI,GAAG,CAC1B,IAAA,aAAK,EAAC,qBAAqB,CAAC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC,CACjE,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC;IAC/C,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function handleInjectionError(target: object, propertyKey: string | symbol | undefined, parameterIndex: number | undefined, error: unknown): never;
|
|
1
|
+
export declare function handleInjectionError<T>(target: object, propertyKey: string | symbol | undefined, parameterIndex: number | TypedPropertyDescriptor<T> | undefined, error: unknown): never;
|
|
2
2
|
//# sourceMappingURL=handleInjectionError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleInjectionError.d.ts","sourceRoot":"","sources":["../../../../src/metadata/calculations/handleInjectionError.ts"],"names":[],"mappings":"AAMA,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"handleInjectionError.d.ts","sourceRoot":"","sources":["../../../../src/metadata/calculations/handleInjectionError.ts"],"names":[],"mappings":"AAMA,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,cAAc,EAAE,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,EAC/D,KAAK,EAAE,OAAO,GACb,KAAK,CA4BP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleInjectionError.js","sourceRoot":"","sources":["../../../../src/metadata/calculations/handleInjectionError.ts"],"names":[],"mappings":";;AAMA,oDAiCC;AAvCD,oFAAiF;AACjF,gGAA6F;AAE7F,8EAA2E;AAC3E,sFAAmF;AAEnF,SAAgB,oBAAoB,CAClC,MAAc,EACd,WAAwC,EACxC,
|
|
1
|
+
{"version":3,"file":"handleInjectionError.js","sourceRoot":"","sources":["../../../../src/metadata/calculations/handleInjectionError.ts"],"names":[],"mappings":";;AAMA,oDAiCC;AAvCD,oFAAiF;AACjF,gGAA6F;AAE7F,8EAA2E;AAC3E,sFAAmF;AAEnF,SAAgB,oBAAoB,CAClC,MAAc,EACd,WAAwC,EACxC,cAA+D,EAC/D,KAAc;IAEd,IACE,uCAAkB,CAAC,aAAa,CAC9B,KAAK,EACL,+CAAsB,CAAC,0BAA0B,CAClD,EACD,CAAC;QACD,MAAM,IAAI,GAAkB,IAAA,mCAAgB,EAC1C,MAAM,EACN,WAAW,EACX,cAAc,CACf,CAAC;QACF,MAAM,IAAI,uCAAkB,CAC1B,+CAAsB,CAAC,0BAA0B,EACjD;;;;EAIJ,KAAK,CAAC,OAAO;;;;EAIb,IAAA,+CAAsB,EAAC,IAAI,CAAC,EAAE,EAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LazyServiceIdentifier, ServiceIdentifier } from '@inversifyjs/common';
|
|
2
|
-
export declare function inject(serviceIdentifier: ServiceIdentifier | LazyServiceIdentifier): ParameterDecorator & PropertyDecorator;
|
|
2
|
+
export declare function inject(serviceIdentifier: ServiceIdentifier | LazyServiceIdentifier): MethodDecorator & ParameterDecorator & PropertyDecorator;
|
|
3
3
|
//# sourceMappingURL=inject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/inject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/inject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAS/E,wBAAgB,MAAM,CACpB,iBAAiB,EAAE,iBAAiB,GAAG,qBAAqB,GAC3D,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,CAS1D"}
|
|
@@ -3,23 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.inject = inject;
|
|
4
4
|
const decrementPendingClassMetadataCount_1 = require("../actions/decrementPendingClassMetadataCount");
|
|
5
5
|
const buildManagedMetadataFromMaybeClassElementMetadata_1 = require("../calculations/buildManagedMetadataFromMaybeClassElementMetadata");
|
|
6
|
-
const handleInjectionError_1 = require("../calculations/handleInjectionError");
|
|
7
6
|
const ClassElementMetadataKind_1 = require("../models/ClassElementMetadataKind");
|
|
8
7
|
const injectBase_1 = require("./injectBase");
|
|
9
8
|
function inject(serviceIdentifier) {
|
|
10
9
|
const updateMetadata = (0, buildManagedMetadataFromMaybeClassElementMetadata_1.buildManagedMetadataFromMaybeClassElementMetadata)(ClassElementMetadataKind_1.ClassElementMetadataKind.singleInjection, serviceIdentifier);
|
|
11
|
-
return (
|
|
12
|
-
try {
|
|
13
|
-
if (parameterIndex === undefined) {
|
|
14
|
-
(0, injectBase_1.injectBase)(updateMetadata, decrementPendingClassMetadataCount_1.decrementPendingClassMetadataCount)(target, propertyKey);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
(0, injectBase_1.injectBase)(updateMetadata, decrementPendingClassMetadataCount_1.decrementPendingClassMetadataCount)(target, propertyKey, parameterIndex);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
(0, handleInjectionError_1.handleInjectionError)(target, propertyKey, parameterIndex, error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
10
|
+
return (0, injectBase_1.injectBase)(updateMetadata, decrementPendingClassMetadataCount_1.decrementPendingClassMetadataCount);
|
|
24
11
|
}
|
|
25
12
|
//# sourceMappingURL=inject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/inject.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"inject.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/inject.ts"],"names":[],"mappings":";;AASA,wBAWC;AAlBD,sGAAmG;AACnG,yIAAsI;AAEtI,iFAA8E;AAE9E,6CAA0C;AAE1C,SAAgB,MAAM,CACpB,iBAA4D;IAE5D,MAAM,cAAc,GAEQ,IAAA,qGAAiD,EAC3E,mDAAwB,CAAC,eAAe,EACxC,iBAAiB,CAClB,CAAC;IAEF,OAAO,IAAA,uBAAU,EAAC,cAAc,EAAE,uEAAkC,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { MaybeClassElementMetadata } from '../models/MaybeClassElementMetadata';
|
|
2
|
-
export declare function injectBase(updateMetadata: (metadata: MaybeClassElementMetadata | undefined) => MaybeClassElementMetadata, updatePendingClassMetadataCount: (target: object) => (metadata: MaybeClassElementMetadata | undefined) => void): ParameterDecorator & PropertyDecorator;
|
|
2
|
+
export declare function injectBase(updateMetadata: (metadata: MaybeClassElementMetadata | undefined) => MaybeClassElementMetadata, updatePendingClassMetadataCount: (target: object) => (metadata: MaybeClassElementMetadata | undefined) => void): MethodDecorator & ParameterDecorator & PropertyDecorator;
|
|
3
|
+
export declare function injectBase(updateMetadata: (metadata: MaybeClassElementMetadata | undefined) => MaybeClassElementMetadata, updatePendingClassMetadataCount: (target: object) => (metadata: MaybeClassElementMetadata | undefined) => void): <T>(target: object, propertyKey: string | symbol | undefined, parameterIndex?: number | TypedPropertyDescriptor<T>) => void;
|
|
3
4
|
//# sourceMappingURL=injectBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectBase.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/injectBase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"injectBase.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/injectBase.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,wBAAgB,UAAU,CACxB,cAAc,EAAE,CACd,QAAQ,EAAE,yBAAyB,GAAG,SAAS,KAC5C,yBAAyB,EAC9B,+BAA+B,EAAE,CAC/B,MAAM,EAAE,MAAM,KACX,CAAC,QAAQ,EAAE,yBAAyB,GAAG,SAAS,KAAK,IAAI,GAC7D,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAC5D,wBAAgB,UAAU,CACxB,cAAc,EAAE,CACd,QAAQ,EAAE,yBAAyB,GAAG,SAAS,KAC5C,yBAAyB,EAC9B,+BAA+B,EAAE,CAC/B,MAAM,EAAE,MAAM,KACX,CAAC,QAAQ,EAAE,yBAAyB,GAAG,SAAS,KAAK,IAAI,GAC7D,CAAC,CAAC,EACH,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,cAAc,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,KACjD,IAAI,CAAC"}
|
|
@@ -2,17 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.injectBase = injectBase;
|
|
4
4
|
const reflect_metadata_utils_1 = require("@inversifyjs/reflect-metadata-utils");
|
|
5
|
+
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
|
|
6
|
+
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
|
|
5
7
|
const classMetadataReflectKey_1 = require("../../reflectMetadata/data/classMetadataReflectKey");
|
|
6
8
|
const updateMaybeClassMetadataConstructorArgument_1 = require("../actions/updateMaybeClassMetadataConstructorArgument");
|
|
7
9
|
const updateMaybeClassMetadataProperty_1 = require("../actions/updateMaybeClassMetadataProperty");
|
|
8
10
|
const getDefaultClassMetadata_1 = require("../calculations/getDefaultClassMetadata");
|
|
11
|
+
const handleInjectionError_1 = require("../calculations/handleInjectionError");
|
|
9
12
|
function injectBase(updateMetadata, updatePendingClassMetadataCount) {
|
|
10
|
-
const decorator = (target, propertyKey,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const decorator = (target, propertyKey, parameterIndexOrDescriptor) => {
|
|
14
|
+
try {
|
|
15
|
+
if (parameterIndexOrDescriptor === undefined) {
|
|
16
|
+
injectProperty(updateMetadata, updatePendingClassMetadataCount)(target, propertyKey);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
if (typeof parameterIndexOrDescriptor === 'number') {
|
|
20
|
+
injectParameter(updateMetadata, updatePendingClassMetadataCount)(target, propertyKey, parameterIndexOrDescriptor);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
injectMethod(updateMetadata, updatePendingClassMetadataCount)(target, propertyKey, parameterIndexOrDescriptor);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
13
26
|
}
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
catch (error) {
|
|
28
|
+
(0, handleInjectionError_1.handleInjectionError)(target, propertyKey, parameterIndexOrDescriptor, error);
|
|
16
29
|
}
|
|
17
30
|
};
|
|
18
31
|
return decorator;
|
|
@@ -26,6 +39,18 @@ function buildComposedUpdateMetadata(updateMetadata, updatePendingClassMetadataC
|
|
|
26
39
|
};
|
|
27
40
|
};
|
|
28
41
|
}
|
|
42
|
+
function injectMethod(updateMetadata, updatePendingClassMetadataCount) {
|
|
43
|
+
const buildComposedUpdateMetadataFromTarget = buildComposedUpdateMetadata(updateMetadata, updatePendingClassMetadataCount);
|
|
44
|
+
return (target, propertyKey, descriptor) => {
|
|
45
|
+
if (isPropertySetter(descriptor)) {
|
|
46
|
+
(0, reflect_metadata_utils_1.updateOwnReflectMetadata)(target.constructor, classMetadataReflectKey_1.classMetadataReflectKey, getDefaultClassMetadata_1.getDefaultClassMetadata, (0, updateMaybeClassMetadataProperty_1.updateMaybeClassMetadataProperty)(buildComposedUpdateMetadataFromTarget(target), propertyKey));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.injectionDecoratorConflict, `Found an @inject decorator in a non setter property method.
|
|
50
|
+
Found @inject decorator at method "${propertyKey.toString()}" at class "${target.constructor.name}"`);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
29
54
|
function injectParameter(updateMetadata, updatePendingClassMetadataCount) {
|
|
30
55
|
const buildComposedUpdateMetadataFromTarget = buildComposedUpdateMetadata(updateMetadata, updatePendingClassMetadataCount);
|
|
31
56
|
return (target, propertyKey, parameterIndex) => {
|
|
@@ -33,7 +58,7 @@ function injectParameter(updateMetadata, updatePendingClassMetadataCount) {
|
|
|
33
58
|
(0, reflect_metadata_utils_1.updateOwnReflectMetadata)(target, classMetadataReflectKey_1.classMetadataReflectKey, getDefaultClassMetadata_1.getDefaultClassMetadata, (0, updateMaybeClassMetadataConstructorArgument_1.updateMaybeClassMetadataConstructorArgument)(buildComposedUpdateMetadataFromTarget(target), parameterIndex));
|
|
34
59
|
}
|
|
35
60
|
else {
|
|
36
|
-
throw new
|
|
61
|
+
throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.injectionDecoratorConflict, `Found an @inject decorator in a non constructor parameter.
|
|
37
62
|
Found @inject decorator at method "${propertyKey?.toString() ?? ''}" at class "${target.constructor.name}"`);
|
|
38
63
|
}
|
|
39
64
|
};
|
|
@@ -47,4 +72,7 @@ function injectProperty(updateMetadata, updatePendingClassMetadataCount) {
|
|
|
47
72
|
function isConstructorParameter(target, propertyKey) {
|
|
48
73
|
return typeof target === 'function' && propertyKey === undefined;
|
|
49
74
|
}
|
|
75
|
+
function isPropertySetter(descriptor) {
|
|
76
|
+
return descriptor.set !== undefined;
|
|
77
|
+
}
|
|
50
78
|
//# sourceMappingURL=injectBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectBase.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/injectBase.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"injectBase.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/injectBase.ts"],"names":[],"mappings":";;AA+BA,gCA+CC;AA9ED,gFAA+E;AAE/E,8EAA2E;AAC3E,sFAAmF;AACnF,gGAA6F;AAC7F,wHAAqH;AACrH,kGAA+F;AAC/F,qFAAkF;AAClF,+EAA4E;AAuB5E,SAAgB,UAAU,CACxB,cAE8B,EAC9B,+BAE8D;IAE9D,MAAM,SAAS,GAA6D,CAG1E,MAAc,EACd,WAAwC,EACxC,0BAAgE,EAC1D,EAAE;QACR,IAAI,CAAC;YACH,IAAI,0BAA0B,KAAK,SAAS,EAAE,CAAC;gBAC7C,cAAc,CAAC,cAAc,EAAE,+BAA+B,CAAC,CAC7D,MAAM,EACN,WAA8B,CAC/B,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE,CAAC;oBACnD,eAAe,CAAC,cAAc,EAAE,+BAA+B,CAAC,CAC9D,MAAM,EACN,WAAW,EACX,0BAA0B,CAC3B,CAAC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3 @@
|
|
|
1
1
|
import { LazyServiceIdentifier, ServiceIdentifier } from '@inversifyjs/common';
|
|
2
|
-
export declare function multiInject(serviceIdentifier: ServiceIdentifier | LazyServiceIdentifier): ParameterDecorator & PropertyDecorator;
|
|
2
|
+
export declare function multiInject(serviceIdentifier: ServiceIdentifier | LazyServiceIdentifier): MethodDecorator & ParameterDecorator & PropertyDecorator;
|
|
3
3
|
//# sourceMappingURL=multiInject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiInject.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/multiInject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"multiInject.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/multiInject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAS/E,wBAAgB,WAAW,CACzB,iBAAiB,EAAE,iBAAiB,GAAG,qBAAqB,GAC3D,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,CAS1D"}
|
|
@@ -3,23 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.multiInject = multiInject;
|
|
4
4
|
const decrementPendingClassMetadataCount_1 = require("../actions/decrementPendingClassMetadataCount");
|
|
5
5
|
const buildManagedMetadataFromMaybeClassElementMetadata_1 = require("../calculations/buildManagedMetadataFromMaybeClassElementMetadata");
|
|
6
|
-
const handleInjectionError_1 = require("../calculations/handleInjectionError");
|
|
7
6
|
const ClassElementMetadataKind_1 = require("../models/ClassElementMetadataKind");
|
|
8
7
|
const injectBase_1 = require("./injectBase");
|
|
9
8
|
function multiInject(serviceIdentifier) {
|
|
10
9
|
const updateMetadata = (0, buildManagedMetadataFromMaybeClassElementMetadata_1.buildManagedMetadataFromMaybeClassElementMetadata)(ClassElementMetadataKind_1.ClassElementMetadataKind.multipleInjection, serviceIdentifier);
|
|
11
|
-
return (
|
|
12
|
-
try {
|
|
13
|
-
if (parameterIndex === undefined) {
|
|
14
|
-
(0, injectBase_1.injectBase)(updateMetadata, decrementPendingClassMetadataCount_1.decrementPendingClassMetadataCount)(target, propertyKey);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
(0, injectBase_1.injectBase)(updateMetadata, decrementPendingClassMetadataCount_1.decrementPendingClassMetadataCount)(target, propertyKey, parameterIndex);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
(0, handleInjectionError_1.handleInjectionError)(target, propertyKey, parameterIndex, error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
10
|
+
return (0, injectBase_1.injectBase)(updateMetadata, decrementPendingClassMetadataCount_1.decrementPendingClassMetadataCount);
|
|
24
11
|
}
|
|
25
12
|
//# sourceMappingURL=multiInject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiInject.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/multiInject.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"multiInject.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/multiInject.ts"],"names":[],"mappings":";;AASA,kCAWC;AAlBD,sGAAmG;AACnG,yIAAsI;AAEtI,iFAA8E;AAE9E,6CAA0C;AAE1C,SAAgB,WAAW,CACzB,iBAA4D;IAE5D,MAAM,cAAc,GAEQ,IAAA,qGAAiD,EAC3E,mDAAwB,CAAC,iBAAiB,EAC1C,iBAAiB,CAClB,CAAC;IAEF,OAAO,IAAA,uBAAU,EAAC,cAAc,EAAE,uEAAkC,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MetadataName } from '../models/MetadataName';
|
|
2
|
-
export declare function named(name: MetadataName): ParameterDecorator & PropertyDecorator;
|
|
2
|
+
export declare function named(name: MetadataName): MethodDecorator & ParameterDecorator & PropertyDecorator;
|
|
3
3
|
//# sourceMappingURL=named.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/named.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"named.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/named.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,wBAAgB,KAAK,CACnB,IAAI,EAAE,YAAY,GACjB,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,CAS1D"}
|
|
@@ -4,22 +4,9 @@ exports.named = named;
|
|
|
4
4
|
const incrementPendingClassMetadataCount_1 = require("../actions/incrementPendingClassMetadataCount");
|
|
5
5
|
const updateMetadataName_1 = require("../actions/updateMetadataName");
|
|
6
6
|
const buildMaybeClassElementMetadataFromMaybeClassElementMetadata_1 = require("../calculations/buildMaybeClassElementMetadataFromMaybeClassElementMetadata");
|
|
7
|
-
const handleInjectionError_1 = require("../calculations/handleInjectionError");
|
|
8
7
|
const injectBase_1 = require("./injectBase");
|
|
9
8
|
function named(name) {
|
|
10
9
|
const updateMetadata = (0, buildMaybeClassElementMetadataFromMaybeClassElementMetadata_1.buildMaybeClassElementMetadataFromMaybeClassElementMetadata)((0, updateMetadataName_1.updateMetadataName)(name));
|
|
11
|
-
return (
|
|
12
|
-
try {
|
|
13
|
-
if (parameterIndex === undefined) {
|
|
14
|
-
(0, injectBase_1.injectBase)(updateMetadata, incrementPendingClassMetadataCount_1.incrementPendingClassMetadataCount)(target, propertyKey);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
(0, injectBase_1.injectBase)(updateMetadata, incrementPendingClassMetadataCount_1.incrementPendingClassMetadataCount)(target, propertyKey, parameterIndex);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
(0, handleInjectionError_1.handleInjectionError)(target, propertyKey, parameterIndex, error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
10
|
+
return (0, injectBase_1.injectBase)(updateMetadata, incrementPendingClassMetadataCount_1.incrementPendingClassMetadataCount);
|
|
24
11
|
}
|
|
25
12
|
//# sourceMappingURL=named.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/named.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"named.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/named.ts"],"names":[],"mappings":";;AASA,sBAWC;AApBD,sGAAmG;AACnG,sEAAmE;AACnE,6JAA0J;AAK1J,6CAA0C;AAE1C,SAAgB,KAAK,CACnB,IAAkB;IAElB,MAAM,cAAc,GAGlB,IAAA,yHAA2D,EACzD,IAAA,uCAAkB,EAAC,IAAI,CAAC,CACzB,CAAC;IAEJ,OAAO,IAAA,uBAAU,EAAC,cAAc,EAAE,uEAAkC,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function optional(): ParameterDecorator & PropertyDecorator;
|
|
1
|
+
export declare function optional(): MethodDecorator & ParameterDecorator & PropertyDecorator;
|
|
2
2
|
//# sourceMappingURL=optional.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/optional.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/optional.ts"],"names":[],"mappings":"AAQA,wBAAgB,QAAQ,IAAI,eAAe,GACzC,kBAAkB,GAClB,iBAAiB,CASlB"}
|
|
@@ -4,22 +4,9 @@ exports.optional = optional;
|
|
|
4
4
|
const incrementPendingClassMetadataCount_1 = require("../actions/incrementPendingClassMetadataCount");
|
|
5
5
|
const updateMetadataOptional_1 = require("../actions/updateMetadataOptional");
|
|
6
6
|
const buildMaybeClassElementMetadataFromMaybeClassElementMetadata_1 = require("../calculations/buildMaybeClassElementMetadataFromMaybeClassElementMetadata");
|
|
7
|
-
const handleInjectionError_1 = require("../calculations/handleInjectionError");
|
|
8
7
|
const injectBase_1 = require("./injectBase");
|
|
9
8
|
function optional() {
|
|
10
9
|
const updateMetadata = (0, buildMaybeClassElementMetadataFromMaybeClassElementMetadata_1.buildMaybeClassElementMetadataFromMaybeClassElementMetadata)(updateMetadataOptional_1.updateMetadataOptional);
|
|
11
|
-
return (
|
|
12
|
-
try {
|
|
13
|
-
if (parameterIndex === undefined) {
|
|
14
|
-
(0, injectBase_1.injectBase)(updateMetadata, incrementPendingClassMetadataCount_1.incrementPendingClassMetadataCount)(target, propertyKey);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
(0, injectBase_1.injectBase)(updateMetadata, incrementPendingClassMetadataCount_1.incrementPendingClassMetadataCount)(target, propertyKey, parameterIndex);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
(0, handleInjectionError_1.handleInjectionError)(target, propertyKey, parameterIndex, error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
10
|
+
return (0, injectBase_1.injectBase)(updateMetadata, incrementPendingClassMetadataCount_1.incrementPendingClassMetadataCount);
|
|
24
11
|
}
|
|
25
12
|
//# sourceMappingURL=optional.js.map
|