@inversifyjs/container
Advanced tools
Comparing version 1.3.4 to 1.4.0
# @inversifyjs/container | ||
## 1.4.0 | ||
### Minor Changes | ||
- 3b47b67: Updated `ContainerOptions` with `autobind` | ||
### Patch Changes | ||
- Updated dependencies | ||
- @inversifyjs/core@3.3.0 | ||
## 1.3.4 | ||
@@ -4,0 +15,0 @@ |
@@ -7,2 +7,3 @@ import { ServiceIdentifier } from '@inversifyjs/common'; | ||
export interface ContainerOptions { | ||
autobind?: true; | ||
defaultScope?: BindingScope | undefined; | ||
@@ -9,0 +10,0 @@ parent?: Container | undefined; |
@@ -28,2 +28,3 @@ "use strict"; | ||
this.#options = { | ||
autobind: options?.autobind ?? false, | ||
defaultScope: options?.defaultScope ?? DEFAULT_DEFAULT_SCOPE, | ||
@@ -175,2 +176,7 @@ }; | ||
const planParams = { | ||
autobindOptions: (options?.autobind ?? this.#options.autobind) | ||
? { | ||
scope: this.#options.defaultScope, | ||
} | ||
: undefined, | ||
getBindings: this.#bindingService.get.bind(this.#bindingService), | ||
@@ -183,2 +189,3 @@ getClassMetadata: core_1.getClassMetadata, | ||
servicesBranch: new Set(), | ||
setBinding: this.#bindingService.set.bind(this.#bindingService), | ||
}; | ||
@@ -185,0 +192,0 @@ this.#handlePlanParamsRootConstraints(planParams, options); |
import { InversifyContainerErrorKind } from './InversifyContainerErrorKind'; | ||
export declare const isAppErrorSymbol: unique symbol; | ||
declare const isAppErrorSymbol: unique symbol; | ||
export declare class InversifyContainerError extends Error { | ||
@@ -10,2 +10,3 @@ [isAppErrorSymbol]: true; | ||
} | ||
export {}; | ||
//# sourceMappingURL=InversifyContainerError.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InversifyContainerError = exports.isAppErrorSymbol = void 0; | ||
exports.isAppErrorSymbol = Symbol.for('@inversifyjs/container/InversifyContainerError'); | ||
exports.InversifyContainerError = void 0; | ||
const isAppErrorSymbol = Symbol.for('@inversifyjs/container/InversifyContainerError'); | ||
class InversifyContainerError extends Error { | ||
[exports.isAppErrorSymbol]; | ||
[isAppErrorSymbol]; | ||
kind; | ||
constructor(kind, message, options) { | ||
super(message, options); | ||
this[exports.isAppErrorSymbol] = true; | ||
this[isAppErrorSymbol] = true; | ||
this.kind = kind; | ||
@@ -16,5 +16,6 @@ } | ||
value !== null && | ||
value[exports.isAppErrorSymbol] === true); | ||
value[isAppErrorSymbol] === true); | ||
} | ||
static isErrorOfKind(value, kind) { | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
return InversifyContainerError.is(value) && value.kind === kind; | ||
@@ -21,0 +22,0 @@ } |
export declare enum InversifyContainerErrorKind { | ||
invalidOperation = 0, | ||
unknown = 1 | ||
invalidOperation = 0 | ||
} | ||
//# sourceMappingURL=InversifyContainerErrorKind.d.ts.map |
@@ -7,4 +7,3 @@ "use strict"; | ||
InversifyContainerErrorKind[InversifyContainerErrorKind["invalidOperation"] = 0] = "invalidOperation"; | ||
InversifyContainerErrorKind[InversifyContainerErrorKind["unknown"] = 1] = "unknown"; | ||
})(InversifyContainerErrorKind || (exports.InversifyContainerErrorKind = InversifyContainerErrorKind = {})); | ||
//# sourceMappingURL=InversifyContainerErrorKind.js.map |
@@ -69,2 +69,3 @@ import { Newable, ServiceIdentifier } from '@inversifyjs/common'; | ||
interface ContainerOptions { | ||
autobind?: true; | ||
defaultScope?: BindingScope | undefined; | ||
@@ -96,4 +97,3 @@ parent?: Container | undefined; | ||
declare enum InversifyContainerErrorKind { | ||
invalidOperation = 0, | ||
unknown = 1 | ||
invalidOperation = 0 | ||
} | ||
@@ -100,0 +100,0 @@ |
@@ -1,2 +0,2 @@ | ||
import"reflect-metadata";import{getOwnReflectMetadata as i,setReflectMetadata as e,updateOwnReflectMetadata as t}from"@inversifyjs/reflect-metadata-utils";import{isPromise as n,stringifyServiceIdentifier as s}from"@inversifyjs/common";import{getClassMetadata as r,bindingTypeValues as o,bindingScopeValues as a,ActivationsService as c,BindingService as d,DeactivationsService as u,resolveServiceDeactivations as l,resolveModuleDeactivations as h,plan as v,resolve as g}from"@inversifyjs/core";const S="@inversifyjs/container/bindingId";class b{#i;#e;constructor(n){this.#i=function(){const n=i(Object,S)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,S,Number.MIN_SAFE_INTEGER):t(Object,S,(()=>n),(i=>i+1)),n}(),this.#e=n}get id(){return this.#i}async load(i){await this.#e(i)}}class f{static always=i=>!0}const y="@inversifyjs/container/bindingId";function p(){const n=i(Object,y)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,y,Number.MIN_SAFE_INTEGER):t(Object,y,(()=>n),(i=>i+1)),n}function w(i){return e=>{for(let t=e.getAncestor();void 0!==t;t=t.getAncestor())if(i(t))return!0;return!1}}function I(i){return e=>e.name===i}function m(i){return e=>e.serviceIdentifier===i}function A(i,e){return t=>t.tags.has(i)&&t.tags.get(i)===e}function P(i){return void 0===i.name&&0===i.tags.size}function B(i){const e=w(i);return i=>!e(i)}function R(i){return e=>{const t=e.getAncestor();return void 0===t||!i(t)}}function N(i){return e=>{const t=e.getAncestor();return void 0!==t&&i(t)}}class M{#t;constructor(i){this.#t=i}inRequestScope(){return this.#t.scope=a.Request,new k(this.#t)}inSingletonScope(){return this.#t.scope=a.Singleton,new k(this.#t)}inTransientScope(){return this.#t.scope=a.Transient,new k(this.#t)}}class F{#n;#s;#r;#o;constructor(i,e,t,n){this.#n=i,this.#s=e,this.#r=t,this.#o=n}to(i){const e=r(i),t={cache:{isRight:!1,value:void 0},id:p(),implementationType:i,isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:e.scope??this.#r,serviceIdentifier:this.#o,type:o.Instance};return this.#n(t),new x(t)}toSelf(){if("function"!=typeof this.#o)throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(this.#o)}toConstantValue(i){const e={cache:{isRight:!1,value:void 0},id:p(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:a.Singleton,serviceIdentifier:this.#o,type:o.ConstantValue,value:i};return this.#n(e),new k(e)}toDynamicValue(i){const e={cache:{isRight:!1,value:void 0},id:p(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:this.#r,serviceIdentifier:this.#o,type:o.DynamicValue,value:i};return this.#n(e),new x(e)}toFactory(i){const e={cache:{isRight:!1,value:void 0},factory:i,id:p(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:a.Singleton,serviceIdentifier:this.#o,type:o.Factory};return this.#n(e),new k(e)}toProvider(i){const e={cache:{isRight:!1,value:void 0},id:p(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,provider:i,scope:a.Singleton,serviceIdentifier:this.#o,type:o.Provider};return this.#n(e),new k(e)}toService(i){const e={id:p(),isSatisfiedBy:f.always,moduleId:this.#s,serviceIdentifier:this.#o,targetServiceIdentifier:i,type:o.ServiceRedirection};this.#n(e)}}class D{#t;constructor(i){this.#t=i}onActivation(i){return this.#t.onActivation=i,new O(this.#t)}onDeactivation(i){return this.#t.onDeactivation=i,new O(this.#t)}}class O{#t;constructor(i){this.#t=i}when(i){return this.#t.isSatisfiedBy=i,new D(this.#t)}whenAnyAncestor(i){return this.when(w(i))}whenAnyAncestorIs(i){return this.when(w(m(i)))}whenAnyAncestorNamed(i){return this.when(function(i){return w(I(i))}(i))}whenAnyAncestorTagged(i,e){return this.when(function(i,e){return w(A(i,e))}(i,e))}whenDefault(){return this.when(P)}whenNamed(i){return this.when(I(i))}whenNoParent(i){return this.when(R(i))}whenNoParentIs(i){return this.when(R(m(i)))}whenNoParentNamed(i){return this.when(function(i){return R(I(i))}(i))}whenNoParentTagged(i,e){return this.when(function(i,e){return R(A(i,e))}(i,e))}whenParent(i){return this.when(N(i))}whenParentIs(i){return this.when(N(m(i)))}whenParentNamed(i){return this.when(function(i){return N(I(i))}(i))}whenParentTagged(i,e){return this.when(function(i,e){return N(A(i,e))}(i,e))}whenTagged(i,e){return this.when(A(i,e))}whenNoAncestor(i){return this.when(B(i))}whenNoAncestorIs(i){return this.when(B(m(i)))}whenNoAncestorNamed(i){return this.when(function(i){return B(I(i))}(i))}whenNoAncestorTagged(i,e){return this.when(function(i,e){return B(A(i,e))}(i,e))}}class k extends O{#a;constructor(i){super(i),this.#a=new D(i)}onActivation(i){return this.#a.onActivation(i)}onDeactivation(i){return this.#a.onDeactivation(i)}}class x extends k{#c;constructor(i){super(i),this.#c=new M(i)}inRequestScope(){return this.#c.inRequestScope()}inSingletonScope(){return this.#c.inSingletonScope()}inTransientScope(){return this.#c.inTransientScope()}}const E=Symbol.for("@inversifyjs/container/InversifyContainerError");class C extends Error{[E];kind;constructor(i,e,t){super(e,t),this[E]=!0,this.kind=i}static is(i){return"object"==typeof i&&null!==i&&!0===i[E]}static isErrorOfKind(i,e){return C.is(i)&&i.kind===e}}var T;!function(i){i[i.invalidOperation=0]="invalidOperation",i[i.unknown=1]="unknown"}(T||(T={}));const j=a.Transient;class _{#d;#u;#l;#h;#v;constructor(i){void 0!==i?.parent?(this.#d=c.build(i.parent.#d),this.#u=d.build(i.parent.#u),this.#l=u.build(i.parent.#l)):(this.#d=c.build(void 0),this.#u=d.build(void 0),this.#l=u.build(void 0)),this.#h={defaultScope:i?.defaultScope??j},this.#v=[]}bind(i){return new F((i=>{this.#u.set(i)}),void 0,this.#h.defaultScope,i)}get(i,e){const t=this.#g(!1,i,e),r=this.#S(t);if(n(r))throw new C(T.invalidOperation,`Unexpected asyncronous service when resolving service "${s(i)}"`);return r}getAll(i,e){const t=this.#g(!0,i,e),r=this.#S(t);if(n(r))throw new C(T.invalidOperation,`Unexpected asyncronous service when resolving service "${s(i)}"`);return r}async getAllAsync(i,e){const t=this.#g(!0,i,e);return this.#S(t)}async getAsync(i,e){const t=this.#g(!1,i,e);return this.#S(t)}isBound(i,e){const t=this.#u.get(i);return this.#b(i,t,e)}isCurrentBound(i,e){const t=this.#u.getNonParentBindings(i);return this.#b(i,t,e)}async load(...i){await Promise.all(i.map((async i=>i.load(this.#f(i.id)))))}onActivation(i,e){this.#d.add(e,{serviceId:i})}onDeactivation(i,e){this.#l.add(e,{serviceId:i})}restore(){const i=this.#v.pop();if(void 0===i)throw new C(T.invalidOperation,"No snapshot available to restore");this.#d=i.activationService,this.#u=i.bindingService,this.#l=i.deactivationService}snapshot(){this.#v.push({activationService:this.#d.clone(),bindingService:this.#u.clone(),deactivationService:this.#l.clone()})}async unbind(i){await l(this.#y(),i),this.#d.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#l.removeAllByServiceId(i)}async unbindAll(){const i=this.#y(),e=[...this.#u.getNonParentBoundServices()];await Promise.all(e.map((async e=>l(i,e))));for(const i of e)this.#d.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#l.removeAllByServiceId(i)}async unload(...i){const e=this.#y();await Promise.all(i.map((i=>h(e,i.id))));for(const e of i)this.#d.removeAllByModuleId(e.id),this.#u.removeAllByModuleId(e.id),this.#l.removeAllByModuleId(e.id)}#f(i){return{bind:e=>new F((i=>{this.#u.set(i)}),i,this.#h.defaultScope,e),isBound:this.isBound.bind(this),onActivation:(e,t)=>{this.#d.add(t,{moduleId:i,serviceId:e})},onDeactivation:(e,t)=>{this.#l.add(t,{moduleId:i,serviceId:e})},unbind:this.unbind.bind(this)}}#y(){return{getBindings:i=>this.#u.get(i),getBindingsFromModule:i=>this.#u.getByModuleId(i),getClassMetadata:r,getDeactivations:i=>this.#l.get(i)}}#g(i,e,t){const n={getBindings:this.#u.get.bind(this.#u),getClassMetadata:r,rootConstraints:{isMultiple:i,serviceIdentifier:e},servicesBranch:new Set};return this.#p(n,t),v(n)}#S(i){return g({context:{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)},getActivations:i=>this.#d.get(i),planResult:i,requestScopeCache:new Map})}#p(i,e){void 0!==e&&(void 0!==e.name&&(i.rootConstraints.name=e.name),!0===e.optional&&(i.rootConstraints.isOptional=!0),void 0!==e.tag&&(i.rootConstraints.tag={key:e.tag.key,value:e.tag.value}))}#b(i,e,t){if(void 0===e)return!1;const n={getAncestor:()=>{},name:t?.name,serviceIdentifier:i,tags:new Map};void 0!==t?.tag&&n.tags.set(t.tag.key,t.tag.value);for(const i of e)if(i.isSatisfiedBy(n))return!0;return!1}}export{_ as Container,b as ContainerModule,C as InversifyContainerError,T as InversifyContainerErrorKind}; | ||
import"reflect-metadata";import{getOwnReflectMetadata as i,setReflectMetadata as e,updateOwnReflectMetadata as t}from"@inversifyjs/reflect-metadata-utils";import{isPromise as n,stringifyServiceIdentifier as s}from"@inversifyjs/common";import{getClassMetadata as r,bindingTypeValues as o,bindingScopeValues as a,ActivationsService as c,BindingService as d,DeactivationsService as u,resolveServiceDeactivations as l,resolveModuleDeactivations as h,plan as v,resolve as g}from"@inversifyjs/core";const S="@inversifyjs/container/bindingId";class b{#i;#e;constructor(n){this.#i=function(){const n=i(Object,S)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,S,Number.MIN_SAFE_INTEGER):t(Object,S,(()=>n),(i=>i+1)),n}(),this.#e=n}get id(){return this.#i}async load(i){await this.#e(i)}}class f{static always=i=>!0}const p="@inversifyjs/container/bindingId";function y(){const n=i(Object,p)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,p,Number.MIN_SAFE_INTEGER):t(Object,p,(()=>n),(i=>i+1)),n}function w(i){return e=>{for(let t=e.getAncestor();void 0!==t;t=t.getAncestor())if(i(t))return!0;return!1}}function I(i){return e=>e.name===i}function m(i){return e=>e.serviceIdentifier===i}function A(i,e){return t=>t.tags.has(i)&&t.tags.get(i)===e}function P(i){return void 0===i.name&&0===i.tags.size}function B(i){const e=w(i);return i=>!e(i)}function R(i){return e=>{const t=e.getAncestor();return void 0===t||!i(t)}}function N(i){return e=>{const t=e.getAncestor();return void 0!==t&&i(t)}}class M{#t;constructor(i){this.#t=i}inRequestScope(){return this.#t.scope=a.Request,new x(this.#t)}inSingletonScope(){return this.#t.scope=a.Singleton,new x(this.#t)}inTransientScope(){return this.#t.scope=a.Transient,new x(this.#t)}}class F{#n;#s;#r;#o;constructor(i,e,t,n){this.#n=i,this.#s=e,this.#r=t,this.#o=n}to(i){const e=r(i),t={cache:{isRight:!1,value:void 0},id:y(),implementationType:i,isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:e.scope??this.#r,serviceIdentifier:this.#o,type:o.Instance};return this.#n(t),new E(t)}toSelf(){if("function"!=typeof this.#o)throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(this.#o)}toConstantValue(i){const e={cache:{isRight:!1,value:void 0},id:y(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:a.Singleton,serviceIdentifier:this.#o,type:o.ConstantValue,value:i};return this.#n(e),new x(e)}toDynamicValue(i){const e={cache:{isRight:!1,value:void 0},id:y(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:this.#r,serviceIdentifier:this.#o,type:o.DynamicValue,value:i};return this.#n(e),new E(e)}toFactory(i){const e={cache:{isRight:!1,value:void 0},factory:i,id:y(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:a.Singleton,serviceIdentifier:this.#o,type:o.Factory};return this.#n(e),new x(e)}toProvider(i){const e={cache:{isRight:!1,value:void 0},id:y(),isSatisfiedBy:f.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,provider:i,scope:a.Singleton,serviceIdentifier:this.#o,type:o.Provider};return this.#n(e),new x(e)}toService(i){const e={id:y(),isSatisfiedBy:f.always,moduleId:this.#s,serviceIdentifier:this.#o,targetServiceIdentifier:i,type:o.ServiceRedirection};this.#n(e)}}class O{#t;constructor(i){this.#t=i}onActivation(i){return this.#t.onActivation=i,new D(this.#t)}onDeactivation(i){return this.#t.onDeactivation=i,new D(this.#t)}}class D{#t;constructor(i){this.#t=i}when(i){return this.#t.isSatisfiedBy=i,new O(this.#t)}whenAnyAncestor(i){return this.when(w(i))}whenAnyAncestorIs(i){return this.when(w(m(i)))}whenAnyAncestorNamed(i){return this.when(function(i){return w(I(i))}(i))}whenAnyAncestorTagged(i,e){return this.when(function(i,e){return w(A(i,e))}(i,e))}whenDefault(){return this.when(P)}whenNamed(i){return this.when(I(i))}whenNoParent(i){return this.when(R(i))}whenNoParentIs(i){return this.when(R(m(i)))}whenNoParentNamed(i){return this.when(function(i){return R(I(i))}(i))}whenNoParentTagged(i,e){return this.when(function(i,e){return R(A(i,e))}(i,e))}whenParent(i){return this.when(N(i))}whenParentIs(i){return this.when(N(m(i)))}whenParentNamed(i){return this.when(function(i){return N(I(i))}(i))}whenParentTagged(i,e){return this.when(function(i,e){return N(A(i,e))}(i,e))}whenTagged(i,e){return this.when(A(i,e))}whenNoAncestor(i){return this.when(B(i))}whenNoAncestorIs(i){return this.when(B(m(i)))}whenNoAncestorNamed(i){return this.when(function(i){return B(I(i))}(i))}whenNoAncestorTagged(i,e){return this.when(function(i,e){return B(A(i,e))}(i,e))}}class x extends D{#a;constructor(i){super(i),this.#a=new O(i)}onActivation(i){return this.#a.onActivation(i)}onDeactivation(i){return this.#a.onDeactivation(i)}}class E extends x{#c;constructor(i){super(i),this.#c=new M(i)}inRequestScope(){return this.#c.inRequestScope()}inSingletonScope(){return this.#c.inSingletonScope()}inTransientScope(){return this.#c.inTransientScope()}}const C=Symbol.for("@inversifyjs/container/InversifyContainerError");class T extends Error{[C];kind;constructor(i,e,t){super(e,t),this[C]=!0,this.kind=i}static is(i){return"object"==typeof i&&null!==i&&!0===i[C]}static isErrorOfKind(i,e){return T.is(i)&&i.kind===e}}var k;!function(i){i[i.invalidOperation=0]="invalidOperation"}(k||(k={}));const j=a.Transient;class _{#d;#u;#l;#h;#v;constructor(i){void 0!==i?.parent?(this.#d=c.build(i.parent.#d),this.#u=d.build(i.parent.#u),this.#l=u.build(i.parent.#l)):(this.#d=c.build(void 0),this.#u=d.build(void 0),this.#l=u.build(void 0)),this.#h={autobind:i?.autobind??!1,defaultScope:i?.defaultScope??j},this.#v=[]}bind(i){return new F((i=>{this.#u.set(i)}),void 0,this.#h.defaultScope,i)}get(i,e){const t=this.#g(!1,i,e),r=this.#S(t);if(n(r))throw new T(k.invalidOperation,`Unexpected asyncronous service when resolving service "${s(i)}"`);return r}getAll(i,e){const t=this.#g(!0,i,e),r=this.#S(t);if(n(r))throw new T(k.invalidOperation,`Unexpected asyncronous service when resolving service "${s(i)}"`);return r}async getAllAsync(i,e){const t=this.#g(!0,i,e);return this.#S(t)}async getAsync(i,e){const t=this.#g(!1,i,e);return this.#S(t)}isBound(i,e){const t=this.#u.get(i);return this.#b(i,t,e)}isCurrentBound(i,e){const t=this.#u.getNonParentBindings(i);return this.#b(i,t,e)}async load(...i){await Promise.all(i.map((async i=>i.load(this.#f(i.id)))))}onActivation(i,e){this.#d.add(e,{serviceId:i})}onDeactivation(i,e){this.#l.add(e,{serviceId:i})}restore(){const i=this.#v.pop();if(void 0===i)throw new T(k.invalidOperation,"No snapshot available to restore");this.#d=i.activationService,this.#u=i.bindingService,this.#l=i.deactivationService}snapshot(){this.#v.push({activationService:this.#d.clone(),bindingService:this.#u.clone(),deactivationService:this.#l.clone()})}async unbind(i){await l(this.#p(),i),this.#d.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#l.removeAllByServiceId(i)}async unbindAll(){const i=this.#p(),e=[...this.#u.getNonParentBoundServices()];await Promise.all(e.map((async e=>l(i,e))));for(const i of e)this.#d.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#l.removeAllByServiceId(i)}async unload(...i){const e=this.#p();await Promise.all(i.map((i=>h(e,i.id))));for(const e of i)this.#d.removeAllByModuleId(e.id),this.#u.removeAllByModuleId(e.id),this.#l.removeAllByModuleId(e.id)}#f(i){return{bind:e=>new F((i=>{this.#u.set(i)}),i,this.#h.defaultScope,e),isBound:this.isBound.bind(this),onActivation:(e,t)=>{this.#d.add(t,{moduleId:i,serviceId:e})},onDeactivation:(e,t)=>{this.#l.add(t,{moduleId:i,serviceId:e})},unbind:this.unbind.bind(this)}}#p(){return{getBindings:i=>this.#u.get(i),getBindingsFromModule:i=>this.#u.getByModuleId(i),getClassMetadata:r,getDeactivations:i=>this.#l.get(i)}}#g(i,e,t){const n={autobindOptions:t?.autobind??this.#h.autobind?{scope:this.#h.defaultScope}:void 0,getBindings:this.#u.get.bind(this.#u),getClassMetadata:r,rootConstraints:{isMultiple:i,serviceIdentifier:e},servicesBranch:new Set,setBinding:this.#u.set.bind(this.#u)};return this.#y(n,t),v(n)}#S(i){return g({context:{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)},getActivations:i=>this.#d.get(i),planResult:i,requestScopeCache:new Map})}#y(i,e){void 0!==e&&(void 0!==e.name&&(i.rootConstraints.name=e.name),!0===e.optional&&(i.rootConstraints.isOptional=!0),void 0!==e.tag&&(i.rootConstraints.tag={key:e.tag.key,value:e.tag.value}))}#b(i,e,t){if(void 0===e)return!1;const n={getAncestor:()=>{},name:t?.name,serviceIdentifier:i,tags:new Map};void 0!==t?.tag&&n.tags.set(t.tag.key,t.tag.value);for(const i of e)if(i.isSatisfiedBy(n))return!0;return!1}}export{_ as Container,b as ContainerModule,T as InversifyContainerError,k as InversifyContainerErrorKind}; | ||
//# sourceMappingURL=index.js.map |
@@ -10,6 +10,5 @@ { | ||
"@inversifyjs/reflect-metadata-utils": "1.1.0", | ||
"@inversifyjs/core": "3.2.0" | ||
"@inversifyjs/core": "3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "9.18.0", | ||
"@jest/globals": "29.7.0", | ||
@@ -19,13 +18,10 @@ "@stryker-mutator/core": "8.7.1", | ||
"@stryker-mutator/typescript-checker": "8.7.1", | ||
"@types/node": "22.10.7", | ||
"@typescript-eslint/eslint-plugin": "8.20.0", | ||
"@typescript-eslint/parser": "8.20.0", | ||
"eslint": "9.18.0", | ||
"@types/node": "22.10.10", | ||
"eslint": "9.19.0", | ||
"jest": "29.7.0", | ||
"prettier": "3.4.2", | ||
"rimraf": "6.0.1", | ||
"rollup": "4.30.1", | ||
"rollup": "4.32.0", | ||
"ts-loader": "9.5.2", | ||
"ts-jest": "29.2.5", | ||
"ts-node": "10.9.2", | ||
"tslib": "2.8.1", | ||
@@ -69,3 +65,3 @@ "typescript": "5.7.3" | ||
}, | ||
"version": "1.3.4", | ||
"version": "1.4.0", | ||
"scripts": { | ||
@@ -72,0 +68,0 @@ "build": "pnpm run build:cjs && pnpm run build:esm", |
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
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
152803
14
1250
+ Added@inversifyjs/core@3.3.0(transitive)
- Removed@inversifyjs/core@3.2.0(transitive)
Updated@inversifyjs/core@3.3.0