ts-ioc-container 35.6.1 → 35.6.3
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.
|
@@ -74,13 +74,13 @@ class Container {
|
|
|
74
74
|
}
|
|
75
75
|
dispose() {
|
|
76
76
|
this.validateContainer();
|
|
77
|
+
for (const scope of this.scopes) {
|
|
78
|
+
scope.dispose();
|
|
79
|
+
}
|
|
77
80
|
this.onDispose.emit(this);
|
|
78
81
|
this.isDisposed = true;
|
|
79
82
|
this.parent.removeScope(this);
|
|
80
83
|
this.parent = new EmptyContainer_1.EmptyContainer();
|
|
81
|
-
for (const scope of this.scopes) {
|
|
82
|
-
scope.dispose();
|
|
83
|
-
}
|
|
84
84
|
this.providers.clear();
|
|
85
85
|
this.instances.clear();
|
|
86
86
|
this.registrations.splice(0, this.registrations.length);
|
|
@@ -18,7 +18,7 @@ const getTransformers = (Target) => (0, metadata_1.getMetadata)(Target, METADATA
|
|
|
18
18
|
exports.getTransformers = getTransformers;
|
|
19
19
|
const register = (...mappers) => (0, metadata_1.setMetadata)(METADATA_KEY, mappers.map((m, index) => {
|
|
20
20
|
if ((0, by_1.isDepKey)(m)) {
|
|
21
|
-
return index === 0 ? m.
|
|
21
|
+
return index === 0 ? m.assignTo.bind(m) : m.redirectFrom.bind(m);
|
|
22
22
|
}
|
|
23
23
|
if ((0, IContainer_1.isDependencyKey)(m)) {
|
|
24
24
|
return (r) => (index === 0 ? r.fromKey(m) : r.redirectFrom(m));
|
|
@@ -71,13 +71,13 @@ export class Container {
|
|
|
71
71
|
}
|
|
72
72
|
dispose() {
|
|
73
73
|
this.validateContainer();
|
|
74
|
+
for (const scope of this.scopes) {
|
|
75
|
+
scope.dispose();
|
|
76
|
+
}
|
|
74
77
|
this.onDispose.emit(this);
|
|
75
78
|
this.isDisposed = true;
|
|
76
79
|
this.parent.removeScope(this);
|
|
77
80
|
this.parent = new EmptyContainer();
|
|
78
|
-
for (const scope of this.scopes) {
|
|
79
|
-
scope.dispose();
|
|
80
|
-
}
|
|
81
81
|
this.providers.clear();
|
|
82
82
|
this.instances.clear();
|
|
83
83
|
this.registrations.splice(0, this.registrations.length);
|
|
@@ -11,7 +11,7 @@ const METADATA_KEY = 'registration';
|
|
|
11
11
|
export const getTransformers = (Target) => getMetadata(Target, METADATA_KEY) ?? [];
|
|
12
12
|
export const register = (...mappers) => setMetadata(METADATA_KEY, mappers.map((m, index) => {
|
|
13
13
|
if (isDepKey(m)) {
|
|
14
|
-
return index === 0 ? m.
|
|
14
|
+
return index === 0 ? m.assignTo.bind(m) : m.redirectFrom.bind(m);
|
|
15
15
|
}
|
|
16
16
|
if (isDependencyKey(m)) {
|
|
17
17
|
return (r) => (index === 0 ? r.fromKey(m) : r.redirectFrom(m));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-ioc-container",
|
|
3
|
-
"version": "35.6.
|
|
3
|
+
"version": "35.6.3",
|
|
4
4
|
"description": "Typescript IoC container",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"ts-node": "^10.9.1",
|
|
60
60
|
"typescript": "5.4.3"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "02aa25e63ad5a51c72744e24e59b71d3cbf83719"
|
|
63
63
|
}
|