@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.
@@ -23,21 +23,21 @@ export class Injector {
23
23
  addValue(token, value) {
24
24
  this.addFactory(token, () => value);
25
25
  }
26
- addModuleInner(set, ...modules) {
26
+ addModuleInner(added, modules) {
27
27
  for (const m of modules) {
28
- if (set.has(m)) {
29
- throw new Error(`Circular dependency detected: ${getModuleName(m)}`);
30
- }
31
- set.add(m);
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(set, imp);
33
+ this.addModuleInner(added, [imp]);
34
34
  }
35
35
  this.addProviders(...(m.providers || []));
36
36
  }
37
37
  }
38
38
  addModule(...modules) {
39
- const set = new Set();
40
- this.addModuleInner(set, ...modules);
39
+ const added = new Set();
40
+ this.addModuleInner(added, [...modules]);
41
41
  }
42
42
  addProvider(p) {
43
43
  const p1 = p;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@art-ws/di",
3
- "version": "2.0.14",
3
+ "version": "2.0.15",
4
4
  "description": "Dependency injection for TypeScript",
5
5
  "license": "UNLICENSED",
6
6
  "author": "art-ws Team",