@art-ws/di 2.0.9 → 2.0.11
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 +2 -2
- package/dist/es/types.d.ts +2 -2
- package/package.json +3 -3
package/dist/es/injector.js
CHANGED
@@ -25,13 +25,13 @@ export class Injector {
|
|
25
25
|
}
|
26
26
|
addModuleInner(set, ...modules) {
|
27
27
|
for (const module of modules) {
|
28
|
-
for (const imp of module.imports) {
|
28
|
+
for (const imp of module.imports || []) {
|
29
29
|
if (set.has(imp))
|
30
30
|
throw new Error(`Circular dependency detected: ${imp}`);
|
31
31
|
set.add(imp);
|
32
32
|
this.addModuleInner(set, imp);
|
33
33
|
}
|
34
|
-
this.addProviders(...module.providers);
|
34
|
+
this.addProviders(...(module.providers || []));
|
35
35
|
}
|
36
36
|
}
|
37
37
|
addModule(...modules) {
|
package/dist/es/types.d.ts
CHANGED
@@ -27,6 +27,6 @@ export type ProviderAngularLikeDef<T = unknown> = {
|
|
27
27
|
};
|
28
28
|
export type Provider<T = unknown> = Type<T> | ProviderCoreDef<T> | ProviderAngularLikeDef<T>;
|
29
29
|
export type DIModuleDef = {
|
30
|
-
imports
|
31
|
-
providers
|
30
|
+
imports?: DIModuleDef[];
|
31
|
+
providers?: Provider[];
|
32
32
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@art-ws/di",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.11",
|
4
4
|
"description": "Dependency injection for TypeScript",
|
5
5
|
"license": "UNLICENSED",
|
6
6
|
"author": "art-ws Team",
|
@@ -15,8 +15,8 @@
|
|
15
15
|
"eslint": "^9.34.0",
|
16
16
|
"typescript": "^5.9.2",
|
17
17
|
"vitest": "^3.2.4",
|
18
|
-
"@art-ws/config-
|
19
|
-
"@art-ws/config-
|
18
|
+
"@art-ws/config-ts": "2.0.6",
|
19
|
+
"@art-ws/config-eslint": "2.0.3"
|
20
20
|
},
|
21
21
|
"scripts": {
|
22
22
|
"build": "tsc",
|