@art-ws/di 2.0.7 → 2.0.8

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.
@@ -60,13 +60,10 @@ export class Injector {
60
60
  get(token) {
61
61
  if (!token)
62
62
  throw new Error(`Token not defined`);
63
- let instance = undefined;
64
- if (this.parent) {
63
+ let instance = this.#instances.get(token);
64
+ if (typeof instance === "undefined" && this.parent) {
65
65
  instance = this.parent.get(token);
66
66
  }
67
- if (typeof instance === "undefined") {
68
- instance = this.#instances.get(token);
69
- }
70
67
  if (typeof instance === "undefined") {
71
68
  const factory = this.#factories.get(token);
72
69
  if (typeof factory === "function") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@art-ws/di",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Dependency injection for TypeScript",
5
5
  "license": "UNLICENSED",
6
6
  "author": "art-ws Team",