Comparing version 0.0.28 to 0.0.29
@@ -54,9 +54,10 @@ import { InjectFlags, Injector } from './injector'; | ||
let reflectiveValue; | ||
const tryValue = {}; | ||
const injectToken = dep.injectKey instanceof ForwardRef ? dep.injectKey.getRef() : dep.injectKey; | ||
if (dep.visibility instanceof Self) { | ||
reflectiveValue = this.get(injectToken, notFoundValue, InjectFlags.Self); | ||
reflectiveValue = this.get(injectToken, tryValue, InjectFlags.Self); | ||
} | ||
else if (dep.visibility instanceof SkipSelf) { | ||
if (this.parentInjector) { | ||
reflectiveValue = this.parentInjector.get(injectToken, notFoundValue, InjectFlags.Default); | ||
reflectiveValue = this.parentInjector.get(injectToken, tryValue, InjectFlags.Default); | ||
} | ||
@@ -68,5 +69,5 @@ else { | ||
else { | ||
reflectiveValue = this.get(injectToken) || ((_a = this.parentInjector) === null || _a === void 0 ? void 0 : _a.get(injectToken)); | ||
reflectiveValue = this.get(injectToken, tryValue) || ((_a = this.parentInjector) === null || _a === void 0 ? void 0 : _a.get(injectToken, tryValue)); | ||
} | ||
if (reflectiveValue === THROW_IF_NOT_FOUND) { | ||
if (reflectiveValue === tryValue) { | ||
if (dep.optional) { | ||
@@ -73,0 +74,0 @@ return notFoundValue; |
{ | ||
"name": "@tanbo/di", | ||
"version": "0.0.28", | ||
"version": "0.0.29", | ||
"description": "A dependency injection Library", | ||
@@ -5,0 +5,0 @@ "main": "./bundles/public-api.js", |
24990
667