ts-ioc-container 33.0.2 → 33.1.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.
@@ -29,6 +29,9 @@ class AutoMockedContainer {
29
29
  getInstances() {
30
30
  return [];
31
31
  }
32
+ getOwnInstances() {
33
+ return [];
34
+ }
32
35
  reduceToRoot(fn, initial) {
33
36
  return initial;
34
37
  }
@@ -70,6 +70,9 @@ class Container {
70
70
  }
71
71
  return instances;
72
72
  }
73
+ getOwnInstances() {
74
+ return Array.from(this.instances);
75
+ }
73
76
  hasTag(tag) {
74
77
  return this.tags.has(tag);
75
78
  }
@@ -46,6 +46,9 @@ class EmptyContainer {
46
46
  getInstances() {
47
47
  return [];
48
48
  }
49
+ getOwnInstances() {
50
+ return [];
51
+ }
49
52
  removeScope() { }
50
53
  use(module) {
51
54
  throw new MethodNotImplementedError_1.MethodNotImplementedError();
@@ -26,6 +26,9 @@ export class AutoMockedContainer {
26
26
  getInstances() {
27
27
  return [];
28
28
  }
29
+ getOwnInstances() {
30
+ return [];
31
+ }
29
32
  reduceToRoot(fn, initial) {
30
33
  return initial;
31
34
  }
@@ -67,6 +67,9 @@ export class Container {
67
67
  }
68
68
  return instances;
69
69
  }
70
+ getOwnInstances() {
71
+ return Array.from(this.instances);
72
+ }
70
73
  hasTag(tag) {
71
74
  return this.tags.has(tag);
72
75
  }
@@ -43,6 +43,9 @@ export class EmptyContainer {
43
43
  getInstances() {
44
44
  return [];
45
45
  }
46
+ getOwnInstances() {
47
+ return [];
48
+ }
46
49
  removeScope() { }
47
50
  use(module) {
48
51
  throw new MethodNotImplementedError();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-ioc-container",
3
- "version": "33.0.2",
3
+ "version": "33.1.0",
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": "2fc46f490e00dfdf60d77861dee309bdcf039d39"
62
+ "gitHead": "284fe762ac07beb7f3747dfb5faf3409055d75df"
63
63
  }
@@ -13,6 +13,7 @@ export declare abstract class AutoMockedContainer implements IContainer {
13
13
  dispose(): void;
14
14
  register(): this;
15
15
  getInstances(): object[];
16
+ getOwnInstances(): object[];
16
17
  reduceToRoot<TResult>(fn: ReduceScope<TResult>, initial: TResult): TResult;
17
18
  removeScope(): void;
18
19
  use(): this;
@@ -26,6 +26,7 @@ export declare class Container implements IContainer {
26
26
  createScope(...tags: Tag[]): Container;
27
27
  dispose(): void;
28
28
  getInstances(direction?: 'parent' | 'child'): object[];
29
+ getOwnInstances(): object[];
29
30
  hasTag(tag: Tag): boolean;
30
31
  use(module: IContainerModule): this;
31
32
  hasDependency(key: DependencyKey): boolean;
@@ -18,6 +18,7 @@ export declare class EmptyContainer implements IContainer {
18
18
  resolve<T>(key: InjectionToken<T>, options: ResolveOptions): T;
19
19
  getRegistrations(): never[];
20
20
  getInstances(): object[];
21
+ getOwnInstances(): object[];
21
22
  removeScope(): void;
22
23
  use(module: IContainerModule): this;
23
24
  add(registration: IRegistration): this;
@@ -33,6 +33,7 @@ export interface IContainer extends Resolvable, Tagged {
33
33
  add(registration: IRegistration): this;
34
34
  removeScope(child: IContainer): void;
35
35
  getInstances(direction?: 'parent' | 'child'): object[];
36
+ getOwnInstances(): object[];
36
37
  dispose(): void;
37
38
  use(module: IContainerModule): this;
38
39
  getRegistrations(): IRegistration[];