@deepkit/injector
Advanced tools
Comparing version 1.0.1-alpha.155 to 1.0.1-alpha.156
@@ -6,2 +6,6 @@ # Change Log | ||
## [1.0.1-alpha.156](https://github.com/deepkit/deepkit-framework/compare/v1.0.1-alpha.155...v1.0.1-alpha.156) (2025-01-30) | ||
**Note:** Version bump only for package @deepkit/injector | ||
## [1.0.1-alpha.155](https://github.com/deepkit/deepkit-framework/compare/v1.0.1-alpha.154...v1.0.1-alpha.155) (2024-10-30) | ||
@@ -8,0 +12,0 @@ |
@@ -17,18 +17,2 @@ "use strict"; | ||
} | ||
var __type0; | ||
var __type1; | ||
var __type2; | ||
var __type3; | ||
var __type4; | ||
var __type5; | ||
var __type6; | ||
var __type7; | ||
var __type8; | ||
var __type9; | ||
var __type10; | ||
var __type11; | ||
var __type12; | ||
var __type13; | ||
var __type14; | ||
var __type15; | ||
const provider_js_1 = require("./provider.js"); | ||
@@ -872,19 +856,19 @@ const core_1 = require("@deepkit/core"); | ||
return (__assignType((scope) => { | ||
return fn(...(args.map(__assignType(v => v(scope), __type0 || (__type0 = ['v', '', 'P"2!"/"']))))); | ||
}, __type1 || (__type1 = [() => __ΩScope, 'scope', '', 'PPn!-J2""/#']))); | ||
return fn(...(args.map(__assignType(v => v(scope), ['v', '', 'P"2!"/"'])))); | ||
}, [() => __ΩScope, 'scope', '', 'PPn!-J2""/#'])); | ||
} | ||
else if (skipParameters === 1) { | ||
return (__assignType((scope, p1) => { | ||
return fn(p1, ...(args.map(__assignType(v => v(scope), __type2 || (__type2 = ['v', '', 'P"2!"/"']))))); | ||
}, __type3 || (__type3 = [() => __ΩScope, 'scope', 'p1', '', 'PPn!-J2""2#"/$']))); | ||
return fn(p1, ...(args.map(__assignType(v => v(scope), ['v', '', 'P"2!"/"'])))); | ||
}, [() => __ΩScope, 'scope', 'p1', '', 'PPn!-J2""2#"/$'])); | ||
} | ||
else if (skipParameters === 2) { | ||
return (__assignType((scope, p1, p2) => { | ||
return fn(p1, p2, ...(args.map(__assignType(v => v(scope), __type4 || (__type4 = ['v', '', 'P"2!"/"']))))); | ||
}, __type5 || (__type5 = [() => __ΩScope, 'scope', 'p1', 'p2', '', 'PPn!-J2""2#"2$"/%']))); | ||
return fn(p1, p2, ...(args.map(__assignType(v => v(scope), ['v', '', 'P"2!"/"'])))); | ||
}, [() => __ΩScope, 'scope', 'p1', 'p2', '', 'PPn!-J2""2#"2$"/%'])); | ||
} | ||
else if (skipParameters === 3) { | ||
return (__assignType((scope, p1, p2, p3) => { | ||
return fn(p1, p2, p3, ...(args.map(__assignType(v => v(scope), __type6 || (__type6 = ['v', '', 'P"2!"/"']))))); | ||
}, __type7 || (__type7 = [() => __ΩScope, 'scope', 'p1', 'p2', 'p3', '', 'PPn!-J2""2#"2$"2%"/&']))); | ||
return fn(p1, p2, p3, ...(args.map(__assignType(v => v(scope), ['v', '', 'P"2!"/"'])))); | ||
}, [() => __ΩScope, 'scope', 'p1', 'p2', 'p3', '', 'PPn!-J2""2#"2$"2%"/&'])); | ||
} | ||
@@ -896,4 +880,4 @@ else { | ||
} | ||
return fn(...input.slice(0, skipParameters), ...(args.map(__assignType(v => v(scope), __type8 || (__type8 = ['v', '', 'P"2!"/"']))))); | ||
}, __type9 || (__type9 = [() => __ΩScope, 'scope', 'input', '', 'PPn!-J2""@2#"/$']))); | ||
return fn(...input.slice(0, skipParameters), ...(args.map(__assignType(v => v(scope), ['v', '', 'P"2!"/"'])))); | ||
}, [() => __ΩScope, 'scope', 'input', '', 'PPn!-J2""@2#"/$'])); | ||
} | ||
@@ -916,3 +900,3 @@ } | ||
return resolver(scope); | ||
}, __type10 || (__type10 = [() => __ΩScope, 'scope', '', 'Pn!2"8"/#'])); | ||
}, [() => __ΩScope, 'scope', '', 'Pn!2"8"/#']); | ||
} | ||
@@ -942,3 +926,3 @@ createLazyResolver.__type = ['Type', 'type', 'label', () => __ΩResolver, 'createLazyResolver', 'P"w!2"&2#8"o$"/%']; | ||
var _a, _b; | ||
const instance = new classType(...(args.map(__assignType((v) => { var _a; return (_a = partial[v.name]) !== null && _a !== void 0 ? _a : v.resolve(scope); }, __type11 || (__type11 = ['v', '', 'P"2!"/"']))))); | ||
const instance = new classType(...(args.map(__assignType((v) => { var _a; return (_a = partial[v.name]) !== null && _a !== void 0 ? _a : v.resolve(scope); }, ['v', '', 'P"2!"/"'])))); | ||
for (const [property, resolve] of properties.entries()) { | ||
@@ -948,3 +932,3 @@ (_a = instance[property]) !== null && _a !== void 0 ? _a : (instance[property] = (_b = partial[property]) !== null && _b !== void 0 ? _b : resolve(scope)); | ||
return instance; | ||
}, __type12 || (__type12 = [() => __ΩPartial, 'partial', '', 'l)"e"!fRPPd"gN#!o!"2""/#'])), __type13 || (__type13 = [() => __ΩScope, 'scope', '', 'Pn!2"8"/#'])); | ||
}, [() => __ΩPartial, 'partial', '', 'l)"e"!fRPPd"gN#!o!"2""/#']), [() => __ΩScope, 'scope', '', 'Pn!2"8"/#']); | ||
} | ||
@@ -965,3 +949,3 @@ if (type.kind === type_1.ReflectionKind.objectLiteral) { | ||
return obj; | ||
}, __type14 || (__type14 = [() => __ΩPartial, 'partial', '', 'l)"e"!fRPPd"gN#!o!"2""/#'])), __type15 || (__type15 = [() => __ΩScope, 'scope', '', 'Pn!2"8"/#'])); | ||
}, [() => __ΩPartial, 'partial', '', 'l)"e"!fRPPd"gN#!o!"2""/#']), [() => __ΩScope, 'scope', '', 'Pn!2"8"/#']); | ||
} | ||
@@ -968,0 +952,0 @@ throw new Error(`Can not create partial factory for ${(0, type_1.stringifyType)(type, { showFullDefinition: false })}`); |
@@ -10,5 +10,2 @@ "use strict"; | ||
} | ||
var __type0; | ||
var __type1; | ||
var __type2; | ||
const core_1 = require("@deepkit/core"); | ||
@@ -31,4 +28,4 @@ const type_1 = require("@deepkit/type"); | ||
const fnWithInjected = __assignType((props) => { | ||
return fn(props, ...(args.map(__assignType(v => v(), __type0 || (__type0 = ['v', '', 'P"2!"/"']))))); | ||
}, __type1 || (__type1 = ['props', '', 'P"2!"/"'])); | ||
return fn(props, ...(args.map(__assignType(v => v(), ['v', '', 'P"2!"/"'])))); | ||
}, ['props', '', 'P"2!"/"']); | ||
return fn.__injected = __assignType(function (props) { | ||
@@ -60,3 +57,3 @@ const children = fnWithInjected(props); | ||
return children; | ||
}, __type2 || (__type2 = ['props', '', 'P"2!"/"'])); | ||
}, ['props', '', 'P"2!"/"']); | ||
} | ||
@@ -63,0 +60,0 @@ exports.wrapComponent = wrapComponent; |
@@ -14,5 +14,2 @@ "use strict"; | ||
} | ||
var __type0; | ||
var __type1; | ||
var __type2; | ||
const provider_js_1 = require("./provider.js"); | ||
@@ -137,3 +134,3 @@ const core_1 = require("@deepkit/core"); | ||
//if the scope is known, overwrite it (we want always the last known provider to be valid) | ||
const knownProvider = preparedProvider.providers.findIndex(__assignType(v => getScope(v) === scope, __type0 || (__type0 = ['v', '', 'P"2!"/"']))); | ||
const knownProvider = preparedProvider.providers.findIndex(__assignType(v => getScope(v) === scope, ['v', '', 'P"2!"/"'])); | ||
if (knownProvider === -1) { | ||
@@ -171,3 +168,3 @@ //scope not known, add it | ||
} | ||
}, __type1 || (__type1 = ['type', 'path', false, '', 'P"2!"2"P.#$J/$']))); | ||
}, ['type', 'path', false, '', 'P"2!"2"P.#$J/$'])); | ||
return found; | ||
@@ -212,3 +209,3 @@ } | ||
function isProvided(providers, token) { | ||
return providers.some(__assignType(v => (0, injector_js_1.getContainerToken)((0, injector_js_1.resolveToken)(v)) === (0, injector_js_1.getContainerToken)(token), __type2 || (__type2 = ['v', '', 'P"2!"/"']))); | ||
return providers.some(__assignType(v => (0, injector_js_1.getContainerToken)((0, injector_js_1.resolveToken)(v)) === (0, injector_js_1.getContainerToken)(token), ['v', '', 'P"2!"/"'])); | ||
} | ||
@@ -215,0 +212,0 @@ exports.isProvided = isProvided; |
{ | ||
"name": "@deepkit/injector", | ||
"version": "1.0.1-alpha.155", | ||
"version": "1.0.1-alpha.156", | ||
"description": "Deepkit Dependency Injection", | ||
@@ -30,4 +30,4 @@ "type": "commonjs", | ||
"devDependencies": { | ||
"@deepkit/core": "^1.0.1-alpha.154", | ||
"@deepkit/type": "^1.0.1-alpha.155", | ||
"@deepkit/core": "^1.0.1-alpha.156", | ||
"@deepkit/type": "^1.0.1-alpha.156", | ||
"benchmark": "^2.1.4" | ||
@@ -52,3 +52,3 @@ }, | ||
}, | ||
"gitHead": "ec3849382ccf5439cd32a85e7b0859457a4ec325" | ||
"gitHead": "b4b8a28943478dddf70830f3f8cff8e818a1abe8" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
507478
6615