@art-ws/di 2.0.14 → 2.0.15
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/es/injector.js +8 -8
- package/package.json +1 -1
package/dist/es/injector.js
CHANGED
@@ -23,21 +23,21 @@ export class Injector {
|
|
23
23
|
addValue(token, value) {
|
24
24
|
this.addFactory(token, () => value);
|
25
25
|
}
|
26
|
-
addModuleInner(
|
26
|
+
addModuleInner(added, modules) {
|
27
27
|
for (const m of modules) {
|
28
|
-
if (
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
if (added.has(m))
|
29
|
+
continue;
|
30
|
+
added.add(m);
|
31
|
+
console.log(`DI: Adding module: ${getModuleName(m)}`);
|
32
32
|
for (const imp of m.imports || []) {
|
33
|
-
this.addModuleInner(
|
33
|
+
this.addModuleInner(added, [imp]);
|
34
34
|
}
|
35
35
|
this.addProviders(...(m.providers || []));
|
36
36
|
}
|
37
37
|
}
|
38
38
|
addModule(...modules) {
|
39
|
-
const
|
40
|
-
this.addModuleInner(
|
39
|
+
const added = new Set();
|
40
|
+
this.addModuleInner(added, [...modules]);
|
41
41
|
}
|
42
42
|
addProvider(p) {
|
43
43
|
const p1 = p;
|