ts-ioc-container 49.0.0 → 49.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.
@@ -17,11 +17,9 @@ const args = (index) => (c, { args = [] }) => {
17
17
  exports.args = args;
18
18
  const argsFn = (fn) => (c, options) => fn(...(options.args ?? []));
19
19
  exports.argsFn = argsFn;
20
- const resolveTokens = (scope, deps) => deps.map((v) => ((0, InjectionToken_1.isInjectionToken)(v) ? v : new ConstantToken_1.ConstantToken(v))).map((t) => t.resolve(scope));
20
+ const argToToken = (v) => ((0, InjectionToken_1.isInjectionToken)(v) ? v : new ConstantToken_1.ConstantToken(v));
21
21
  const resolveArgs = (Target, methodName) => {
22
- const argsMetaTokens = (0, parameter_1.getParamMeta)(hookMetaKey(methodName), Target);
23
- return (scope, { args = [], lazy }) => {
24
- return argsMetaTokens.map((fn) => fn.resolve(scope, { args: resolveTokens(scope, args), lazy }));
25
- };
22
+ const tokens = (0, parameter_1.getParamMeta)(hookMetaKey(methodName), Target);
23
+ return (scope, { args = [], lazy }) => tokens.map((fn) => fn.resolve(scope, { args: args.map(argToToken).map((t) => t.resolve(scope)), lazy }));
26
24
  };
27
25
  exports.resolveArgs = resolveArgs;
@@ -11,10 +11,8 @@ export const args = (index) => (c, { args = [] }) => {
11
11
  return args[index];
12
12
  };
13
13
  export const argsFn = (fn) => (c, options) => fn(...(options.args ?? []));
14
- const resolveTokens = (scope, deps) => deps.map((v) => (isInjectionToken(v) ? v : new ConstantToken(v))).map((t) => t.resolve(scope));
14
+ const argToToken = (v) => (isInjectionToken(v) ? v : new ConstantToken(v));
15
15
  export const resolveArgs = (Target, methodName) => {
16
- const argsMetaTokens = getParamMeta(hookMetaKey(methodName), Target);
17
- return (scope, { args = [], lazy }) => {
18
- return argsMetaTokens.map((fn) => fn.resolve(scope, { args: resolveTokens(scope, args), lazy }));
19
- };
16
+ const tokens = getParamMeta(hookMetaKey(methodName), Target);
17
+ return (scope, { args = [], lazy }) => tokens.map((fn) => fn.resolve(scope, { args: args.map(argToToken).map((t) => t.resolve(scope)), lazy }));
20
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-ioc-container",
3
- "version": "49.0.0",
3
+ "version": "49.1.0",
4
4
  "description": "Fast, lightweight TypeScript dependency injection container with a clean API, scoped lifecycles, decorators, tokens, hooks, lazy injection, customizable providers, and no global container objects.",
5
5
  "workspaces": [
6
6
  "docs"