@poppinss/utils
Advanced tools
Comparing version 1.0.7 to 1.0.9
@@ -5,4 +5,4 @@ export { Exception } from './src/Exception'; | ||
export { esmResolver } from './src/esmResolver'; | ||
export { IoCResolver } from './src/IocResolver'; | ||
export { IoCResolver, IocResolverLookupNode } from './src/IocResolver'; | ||
export { parseIocReference } from './src/depreciated/parseIocReference'; | ||
export { callIocReference } from './src/depreciated/callIocReference'; |
import { IocContract } from '@adonisjs/fold'; | ||
export declare type IocResolverLookupNode = { | ||
namespace: string; | ||
type: 'binding' | 'autoload'; | ||
method: string; | ||
}; | ||
export declare class IoCResolver { | ||
@@ -10,8 +15,4 @@ private _container; | ||
private _getPrefixNamespace; | ||
resolve(namespace: string, prefixNamespace?: string | undefined): { | ||
namespace: string; | ||
type: "binding" | "autoload"; | ||
method: string; | ||
}; | ||
call<T extends any>(namespace: string, prefixNamespace?: string, args?: any[]): T; | ||
resolve(namespace: string, prefixNamespace?: string | undefined): IocResolverLookupNode; | ||
call<T extends any>(namespace: string | IocResolverLookupNode, prefixNamespace?: string, args?: any[]): T; | ||
} |
@@ -43,3 +43,5 @@ "use strict"; | ||
call(namespace, prefixNamespace, args) { | ||
const lookupNode = this.resolve(namespace, prefixNamespace); | ||
const lookupNode = typeof (namespace) === 'string' | ||
? this.resolve(namespace, prefixNamespace) | ||
: namespace; | ||
return this._container.call(this._container.make(lookupNode.namespace), lookupNode.method, args || []); | ||
@@ -46,0 +48,0 @@ } |
{ | ||
"name": "@poppinss/utils", | ||
"version": "1.0.7", | ||
"version": "1.0.9", | ||
"description": "Handy utilities for repetitive work", | ||
@@ -12,3 +12,3 @@ "scripts": { | ||
"compile": "npm run lint && npm run clean && tsc", | ||
"build": "npm run compile && typedoc --theme markdown --mdHideSources --excludePrivate && git add docs", | ||
"build": "npm run compile && typedoc --theme markdown --HideSources --excludePrivate && git add docs", | ||
"commit": "git-cz", | ||
@@ -26,4 +26,4 @@ "release": "np", | ||
"@adonisjs/mrm-preset": "^2.1.0", | ||
"@poppinss/dev-utils": "^1.0.0", | ||
"@types/node": "^12.7.2", | ||
"@poppinss/dev-utils": "^1.0.1", | ||
"@types/node": "^12.7.4", | ||
"commitizen": "^4.0.3", | ||
@@ -33,4 +33,4 @@ "cz-conventional-changelog": "^3.0.2", | ||
"doctoc": "^1.4.0", | ||
"husky": "^3.0.4", | ||
"japa": "^3.0.0", | ||
"husky": "^3.0.5", | ||
"japa": "^3.0.1", | ||
"mrm": "^1.2.2", | ||
@@ -43,3 +43,3 @@ "np": "^5.0.3", | ||
"typedoc-plugin-external-module-name": "^2.1.0", | ||
"typedoc-plugin-markdown": "^2.1.4", | ||
"typedoc-plugin-markdown": "^2.1.10", | ||
"typescript": "^3.6.2" | ||
@@ -46,0 +46,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17715
247