@spinajs/di
Advanced tools
Comparing version 1.2.32 to 1.2.68
@@ -8,2 +8,3 @@ import { TypedArray } from './array'; | ||
constructor(container: IContainer); | ||
remove(key: string | Class<any> | TypedArray<any>, parent?: boolean): void; | ||
add(key: string | Class<any> | object, instance: any): void; | ||
@@ -10,0 +11,0 @@ has(key: string | Class<any> | object | TypedArray<any>, parent?: boolean): boolean; |
@@ -13,2 +13,10 @@ "use strict"; | ||
} | ||
remove(key, parent) { | ||
if (this.has(key)) { | ||
this.cache.delete((0, helpers_1.getTypeName)(key)); | ||
} | ||
else if (parent && this.container.Parent) { | ||
this.container.Parent.uncache(key); | ||
} | ||
} | ||
add(key, instance) { | ||
@@ -15,0 +23,0 @@ const tName = (0, helpers_1.getTypeName)(key); |
@@ -52,2 +52,3 @@ /// <reference types="node" /> | ||
unregister<T>(implementation: Class<T> | Factory<T> | ResolvableObject): void; | ||
uncache<T>(implementation: string | Class<T> | TypedArray<T>, parent?: boolean): void; | ||
/** | ||
@@ -54,0 +55,0 @@ * Creates child DI container. |
@@ -73,2 +73,5 @@ "use strict"; | ||
} | ||
uncache(implementation, parent) { | ||
this.Cache.remove(implementation, parent); | ||
} | ||
/** | ||
@@ -75,0 +78,0 @@ * Creates child DI container. |
@@ -45,2 +45,3 @@ /// <reference types="node" /> | ||
unregister<T>(implementation: Class<T> | Factory<T> | ResolvableObject): void; | ||
uncache<T>(source: string | Class<T> | TypedArray<T>, parent?: boolean): void; | ||
child(): IContainer; | ||
@@ -47,0 +48,0 @@ get<T>(service: TypedArray<T>, parent?: boolean): T[] | null; |
@@ -50,2 +50,3 @@ import { IBind, IContainer, AsyncModule, ResolvableObject } from './interfaces'; | ||
export declare function unregister<T>(type: Class<T> | Factory<T> | ResolvableObject): void; | ||
export declare function uncashe<T>(type: string | Class<T> | TypedArray<T>, parent?: boolean): void; | ||
/** | ||
@@ -52,0 +53,0 @@ * Resolves specified type from root container. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.child = exports.check = exports.has = exports.get = exports.resolve = exports.unregister = exports.register = exports.clearCache = exports.clearRegistry = exports.clear = exports.eventNames = exports.prependOnceListener = exports.prependListener = exports.listenerCount = exports.emit = exports.rawListeners = exports.listeners = exports.getMaxListeners = exports.setMaxListeners = exports.removeAllListeners = exports.off = exports.removeListener = exports.once = exports.addListener = exports.on = exports.RootContainer = void 0; | ||
exports.child = exports.check = exports.has = exports.get = exports.resolve = exports.uncashe = exports.unregister = exports.register = exports.clearCache = exports.clearRegistry = exports.clear = exports.eventNames = exports.prependOnceListener = exports.prependListener = exports.listenerCount = exports.emit = exports.rawListeners = exports.listeners = exports.getMaxListeners = exports.setMaxListeners = exports.removeAllListeners = exports.off = exports.removeListener = exports.once = exports.addListener = exports.on = exports.RootContainer = void 0; | ||
const container_1 = require("./container"); | ||
@@ -109,5 +109,9 @@ /** | ||
function unregister(type) { | ||
return exports.RootContainer.unregister(type); | ||
exports.RootContainer.unregister(type); | ||
} | ||
exports.unregister = unregister; | ||
function uncashe(type, parent) { | ||
exports.RootContainer.uncache(type, parent); | ||
} | ||
exports.uncashe = uncashe; | ||
function resolve(type, options, check) { | ||
@@ -114,0 +118,0 @@ return exports.RootContainer.resolve(type, options, check); |
{ | ||
"name": "@spinajs/di", | ||
"version": "1.2.32", | ||
"version": "1.2.68", | ||
"description": "lightweight di container ", | ||
@@ -46,3 +46,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "ee029f2a9376ac0866973e73b47d0c242e849157" | ||
"gitHead": "4df6ba1f117af546434773102c1a564b34ca9f12" | ||
} |
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
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
91936
1649