New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@inversifyjs/container

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inversifyjs/container - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

6

CHANGELOG.md
# @inversifyjs/container
## 1.5.2
### Patch Changes
- 6c38c39: Updated Container.restore to refresh computed properties
## 1.5.1

@@ -4,0 +10,0 @@

9

lib/cjs/container/services/Container.js

@@ -102,3 +102,3 @@ "use strict";

this.#deactivationService = snapshot.deactivationService;
this.#planResultCacheService.clearCache();
this.#resetComputedProperties();
}

@@ -281,2 +281,9 @@ snapshot() {

}
#resetComputedProperties() {
this.#planResultCacheService.clearCache();
this.#getActivationsResolutionParam = (serviceIdentifier) => this.#activationService.get(serviceIdentifier);
this.#getBindingsPlanParams = this.#bindingService.get.bind(this.#bindingService);
this.#resolutionContext = this.#buildResolutionContext();
this.#setBindingParamsPlan = this.#setBinding.bind(this);
}
#setBinding(binding) {

@@ -283,0 +290,0 @@ this.#bindingService.set(binding);

2

lib/esm/index.js

@@ -1,2 +0,2 @@

import"reflect-metadata";import{getOwnReflectMetadata as i,setReflectMetadata as e,updateOwnReflectMetadata as t}from"@inversifyjs/reflect-metadata-utils";import{LazyServiceIdentifier as n,isPromise as s,stringifyServiceIdentifier as a}from"@inversifyjs/common";import{getClassMetadata as o,bindingTypeValues as r,bindingScopeValues as c,ResolvedValueElementMetadataKind as d,PlanResultCacheService as l,ActivationsService as u,BindingService as h,DeactivationsService as v,resolveServiceDeactivations as g,resolveModuleDeactivations as S,plan as b,resolve as p}from"@inversifyjs/core";const f="@inversifyjs/container/bindingId";class y{#i;#e;constructor(n){this.#i=function(){const n=i(Object,f)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,f,Number.MIN_SAFE_INTEGER):t(Object,f,(()=>n),(i=>i+1)),n}(),this.#e=n}get id(){return this.#i}async load(i){await this.#e(i)}}class m{static always=i=>!0}const w="@inversifyjs/container/bindingId";function I(){const n=i(Object,w)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,w,Number.MIN_SAFE_INTEGER):t(Object,w,(()=>n),(i=>i+1)),n}function A(i){return e=>{for(let t=e.getAncestor();void 0!==t;t=t.getAncestor())if(i(t))return!0;return!1}}function P(i){return e=>e.name===i}function R(i){return e=>e.serviceIdentifier===i}function B(i,e){return t=>t.tags.has(i)&&t.tags.get(i)===e}function C(i){return void 0===i.name&&0===i.tags.size}function M(i){const e=A(i);return i=>!e(i)}function N(i){return e=>{const t=e.getAncestor();return void 0===t||!i(t)}}function O(i){return e=>{const t=e.getAncestor();return void 0!==t&&i(t)}}class x{#t;constructor(i){this.#t=i}inRequestScope(){return this.#t.scope=c.Request,new j(this.#t)}inSingletonScope(){return this.#t.scope=c.Singleton,new j(this.#t)}inTransientScope(){return this.#t.scope=c.Transient,new j(this.#t)}}class F{#n;#s;#a;#o;constructor(i,e,t,n){this.#n=i,this.#s=e,this.#a=t,this.#o=n}to(i){const e=o(i),t={cache:{isRight:!1,value:void 0},id:I(),implementationType:i,isSatisfiedBy:m.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:e.scope??this.#a,serviceIdentifier:this.#o,type:r.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:I(),isSatisfiedBy:m.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:c.Singleton,serviceIdentifier:this.#o,type:r.ConstantValue,value:i};return this.#n(e),new j(e)}toDynamicValue(i){const e={cache:{isRight:!1,value:void 0},id:I(),isSatisfiedBy:m.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:this.#a,serviceIdentifier:this.#o,type:r.DynamicValue,value:i};return this.#n(e),new E(e)}toResolvedValue(i,e){const t={cache:{isRight:!1,value:void 0},factory:i,id:I(),isSatisfiedBy:m.always,metadata:this.#r(e),moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:this.#a,serviceIdentifier:this.#o,type:r.ResolvedValue};return this.#n(t),new E(t)}toFactory(i){const e={cache:{isRight:!1,value:void 0},factory:i,id:I(),isSatisfiedBy:m.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:c.Singleton,serviceIdentifier:this.#o,type:r.Factory};return this.#n(e),new j(e)}toProvider(i){const e={cache:{isRight:!1,value:void 0},id:I(),isSatisfiedBy:m.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,provider:i,scope:c.Singleton,serviceIdentifier:this.#o,type:r.Provider};return this.#n(e),new j(e)}toService(i){const e={id:I(),isSatisfiedBy:m.always,moduleId:this.#s,serviceIdentifier:this.#o,targetServiceIdentifier:i,type:r.ServiceRedirection};this.#n(e)}#r(i){return{arguments:(i??[]).map((i=>function(i){return"object"==typeof i&&!n.is(i)}(i)?{kind:!0===i.isMultiple?d.multipleInjection:d.singleInjection,name:i.name,optional:i.optional??!1,tags:new Map((i.tags??[]).map((i=>[i.key,i.value]))),value:i.serviceIdentifier}:{kind:d.singleInjection,name:void 0,optional:!1,tags:new Map,value:i}))}}}class D{#t;constructor(i){this.#t=i}onActivation(i){return this.#t.onActivation=i,new k(this.#t)}onDeactivation(i){return this.#t.onDeactivation=i,new k(this.#t)}}class k{#t;constructor(i){this.#t=i}when(i){return this.#t.isSatisfiedBy=i,new D(this.#t)}whenAnyAncestor(i){return this.when(A(i))}whenAnyAncestorIs(i){return this.when(A(R(i)))}whenAnyAncestorNamed(i){return this.when(function(i){return A(P(i))}(i))}whenAnyAncestorTagged(i,e){return this.when(function(i,e){return A(B(i,e))}(i,e))}whenDefault(){return this.when(C)}whenNamed(i){return this.when(P(i))}whenNoParent(i){return this.when(N(i))}whenNoParentIs(i){return this.when(N(R(i)))}whenNoParentNamed(i){return this.when(function(i){return N(P(i))}(i))}whenNoParentTagged(i,e){return this.when(function(i,e){return N(B(i,e))}(i,e))}whenParent(i){return this.when(O(i))}whenParentIs(i){return this.when(O(R(i)))}whenParentNamed(i){return this.when(function(i){return O(P(i))}(i))}whenParentTagged(i,e){return this.when(function(i,e){return O(B(i,e))}(i,e))}whenTagged(i,e){return this.when(B(i,e))}whenNoAncestor(i){return this.when(M(i))}whenNoAncestorIs(i){return this.when(M(R(i)))}whenNoAncestorNamed(i){return this.when(function(i){return M(P(i))}(i))}whenNoAncestorTagged(i,e){return this.when(function(i,e){return M(B(i,e))}(i,e))}}class j extends k{#c;constructor(i){super(i),this.#c=new D(i)}onActivation(i){return this.#c.onActivation(i)}onDeactivation(i){return this.#c.onDeactivation(i)}}class E extends j{#d;constructor(i){super(i),this.#d=new x(i)}inRequestScope(){return this.#d.inRequestScope()}inSingletonScope(){return this.#d.inSingletonScope()}inTransientScope(){return this.#d.inTransientScope()}}const T=Symbol.for("@inversifyjs/container/InversifyContainerError");class V extends Error{[T];kind;constructor(i,e,t){super(e,t),this[T]=!0,this.kind=i}static is(i){return"object"==typeof i&&null!==i&&!0===i[T]}static isErrorOfKind(i,e){return V.is(i)&&i.kind===e}}var _;!function(i){i[i.invalidOperation=0]="invalidOperation"}(_||(_={}));const G=c.Transient;class q{#l;#u;#h;#v;#g;#S;#b;#p;#f;#y;constructor(i){this.#v=i=>this.#l.get(i),this.#b=new l,this.#p=this.#m(),void 0===i?.parent?(this.#l=u.build(void 0),this.#u=h.build(void 0),this.#h=v.build(void 0)):(this.#l=u.build(i.parent.#l),this.#u=h.build(i.parent.#u),this.#h=v.build(i.parent.#h),i.parent.#b.subscribe(this.#b)),this.#g=this.#u.get.bind(this.#u),this.#f=this.#w.bind(this),this.#S={autobind:i?.autobind??!1,defaultScope:i?.defaultScope??G},this.#y=[]}bind(i){return new F((i=>{this.#w(i)}),void 0,this.#S.defaultScope,i)}get(i,e){const t=this.#I(!1,i,e),n=this.#A(t);if(s(n))throw new V(_.invalidOperation,`Unexpected asyncronous service when resolving service "${a(i)}"`);return n}getAll(i,e){const t=this.#I(!0,i,e),n=this.#A(t);if(s(n))throw new V(_.invalidOperation,`Unexpected asyncronous service when resolving service "${a(i)}"`);return n}async getAllAsync(i,e){const t=this.#I(!0,i,e);return this.#A(t)}async getAsync(i,e){const t=this.#I(!1,i,e);return this.#A(t)}isBound(i,e){const t=this.#u.get(i);return this.#P(i,t,e)}isCurrentBound(i,e){const t=this.#u.getNonParentBindings(i);return this.#P(i,t,e)}async load(...i){await Promise.all(i.map((async i=>i.load(this.#R(i.id)))))}onActivation(i,e){this.#l.add(e,{serviceId:i})}onDeactivation(i,e){this.#h.add(e,{serviceId:i})}restore(){const i=this.#y.pop();if(void 0===i)throw new V(_.invalidOperation,"No snapshot available to restore");this.#l=i.activationService,this.#u=i.bindingService,this.#h=i.deactivationService,this.#b.clearCache()}snapshot(){this.#y.push({activationService:this.#l.clone(),bindingService:this.#u.clone(),deactivationService:this.#h.clone()})}async unbind(i){await g(this.#B(),i),this.#l.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#h.removeAllByServiceId(i),this.#b.clearCache()}async unbindAll(){const i=this.#B(),e=[...this.#u.getNonParentBoundServices()];await Promise.all(e.map((async e=>g(i,e))));for(const i of e)this.#l.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#h.removeAllByServiceId(i);this.#b.clearCache()}async unload(...i){const e=this.#B();await Promise.all(i.map((i=>S(e,i.id))));for(const e of i)this.#l.removeAllByModuleId(e.id),this.#u.removeAllByModuleId(e.id),this.#h.removeAllByModuleId(e.id);this.#b.clearCache()}#R(i){return{bind:e=>new F((i=>{this.#w(i)}),i,this.#S.defaultScope,e),isBound:this.isBound.bind(this),onActivation:(e,t)=>{this.#l.add(t,{moduleId:i,serviceId:e})},onDeactivation:(e,t)=>{this.#h.add(t,{moduleId:i,serviceId:e})},unbind:this.unbind.bind(this)}}#B(){return{getBindings:i=>this.#u.get(i),getBindingsFromModule:i=>this.#u.getByModuleId(i),getClassMetadata:o,getDeactivations:i=>this.#h.get(i)}}#C(i,e,t){return{isMultiple:i,name:t?.name,optional:t?.optional,serviceIdentifier:e,tag:t?.tag}}#M(i,e,t){const n={autobindOptions:t?.autobind??this.#S.autobind?{scope:this.#S.defaultScope}:void 0,getBindings:this.#g,getClassMetadata:o,rootConstraints:{isMultiple:i,serviceIdentifier:e},servicesBranch:new Set,setBinding:this.#f};return this.#N(n,t),n}#I(i,e,t){const n=this.#C(i,e,t),s=this.#b.get(n);if(void 0!==s)return s;const a=b(this.#M(i,e,t));return this.#b.set(n,a),a}#m(){return{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}}#A(i){return p({context:this.#p,getActivations:this.#v,planResult:i,requestScopeCache:new Map})}#N(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}))}#P(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}#w(i){this.#u.set(i),this.#b.clearCache()}}export{q as Container,y as ContainerModule,V as InversifyContainerError,_ as InversifyContainerErrorKind};
import"reflect-metadata";import{getOwnReflectMetadata as i,setReflectMetadata as e,updateOwnReflectMetadata as t}from"@inversifyjs/reflect-metadata-utils";import{LazyServiceIdentifier as n,isPromise as s,stringifyServiceIdentifier as a}from"@inversifyjs/common";import{getClassMetadata as o,bindingTypeValues as r,bindingScopeValues as c,ResolvedValueElementMetadataKind as d,PlanResultCacheService as l,ActivationsService as u,BindingService as h,DeactivationsService as v,resolveServiceDeactivations as g,resolveModuleDeactivations as b,plan as S,resolve as p}from"@inversifyjs/core";const f="@inversifyjs/container/bindingId";class m{#i;#e;constructor(n){this.#i=function(){const n=i(Object,f)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,f,Number.MIN_SAFE_INTEGER):t(Object,f,(()=>n),(i=>i+1)),n}(),this.#e=n}get id(){return this.#i}async load(i){await this.#e(i)}}class y{static always=i=>!0}const w="@inversifyjs/container/bindingId";function I(){const n=i(Object,w)??0;return n===Number.MAX_SAFE_INTEGER?e(Object,w,Number.MIN_SAFE_INTEGER):t(Object,w,(()=>n),(i=>i+1)),n}function A(i){return e=>{for(let t=e.getAncestor();void 0!==t;t=t.getAncestor())if(i(t))return!0;return!1}}function P(i){return e=>e.name===i}function R(i){return e=>e.serviceIdentifier===i}function B(i,e){return t=>t.tags.has(i)&&t.tags.get(i)===e}function C(i){return void 0===i.name&&0===i.tags.size}function M(i){const e=A(i);return i=>!e(i)}function N(i){return e=>{const t=e.getAncestor();return void 0===t||!i(t)}}function x(i){return e=>{const t=e.getAncestor();return void 0!==t&&i(t)}}class O{#t;constructor(i){this.#t=i}inRequestScope(){return this.#t.scope=c.Request,new j(this.#t)}inSingletonScope(){return this.#t.scope=c.Singleton,new j(this.#t)}inTransientScope(){return this.#t.scope=c.Transient,new j(this.#t)}}class F{#n;#s;#a;#o;constructor(i,e,t,n){this.#n=i,this.#s=e,this.#a=t,this.#o=n}to(i){const e=o(i),t={cache:{isRight:!1,value:void 0},id:I(),implementationType:i,isSatisfiedBy:y.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:e.scope??this.#a,serviceIdentifier:this.#o,type:r.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:I(),isSatisfiedBy:y.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:c.Singleton,serviceIdentifier:this.#o,type:r.ConstantValue,value:i};return this.#n(e),new j(e)}toDynamicValue(i){const e={cache:{isRight:!1,value:void 0},id:I(),isSatisfiedBy:y.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:this.#a,serviceIdentifier:this.#o,type:r.DynamicValue,value:i};return this.#n(e),new E(e)}toResolvedValue(i,e){const t={cache:{isRight:!1,value:void 0},factory:i,id:I(),isSatisfiedBy:y.always,metadata:this.#r(e),moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:this.#a,serviceIdentifier:this.#o,type:r.ResolvedValue};return this.#n(t),new E(t)}toFactory(i){const e={cache:{isRight:!1,value:void 0},factory:i,id:I(),isSatisfiedBy:y.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,scope:c.Singleton,serviceIdentifier:this.#o,type:r.Factory};return this.#n(e),new j(e)}toProvider(i){const e={cache:{isRight:!1,value:void 0},id:I(),isSatisfiedBy:y.always,moduleId:this.#s,onActivation:void 0,onDeactivation:void 0,provider:i,scope:c.Singleton,serviceIdentifier:this.#o,type:r.Provider};return this.#n(e),new j(e)}toService(i){const e={id:I(),isSatisfiedBy:y.always,moduleId:this.#s,serviceIdentifier:this.#o,targetServiceIdentifier:i,type:r.ServiceRedirection};this.#n(e)}#r(i){return{arguments:(i??[]).map((i=>function(i){return"object"==typeof i&&!n.is(i)}(i)?{kind:!0===i.isMultiple?d.multipleInjection:d.singleInjection,name:i.name,optional:i.optional??!1,tags:new Map((i.tags??[]).map((i=>[i.key,i.value]))),value:i.serviceIdentifier}:{kind:d.singleInjection,name:void 0,optional:!1,tags:new Map,value:i}))}}}class D{#t;constructor(i){this.#t=i}onActivation(i){return this.#t.onActivation=i,new k(this.#t)}onDeactivation(i){return this.#t.onDeactivation=i,new k(this.#t)}}class k{#t;constructor(i){this.#t=i}when(i){return this.#t.isSatisfiedBy=i,new D(this.#t)}whenAnyAncestor(i){return this.when(A(i))}whenAnyAncestorIs(i){return this.when(A(R(i)))}whenAnyAncestorNamed(i){return this.when(function(i){return A(P(i))}(i))}whenAnyAncestorTagged(i,e){return this.when(function(i,e){return A(B(i,e))}(i,e))}whenDefault(){return this.when(C)}whenNamed(i){return this.when(P(i))}whenNoParent(i){return this.when(N(i))}whenNoParentIs(i){return this.when(N(R(i)))}whenNoParentNamed(i){return this.when(function(i){return N(P(i))}(i))}whenNoParentTagged(i,e){return this.when(function(i,e){return N(B(i,e))}(i,e))}whenParent(i){return this.when(x(i))}whenParentIs(i){return this.when(x(R(i)))}whenParentNamed(i){return this.when(function(i){return x(P(i))}(i))}whenParentTagged(i,e){return this.when(function(i,e){return x(B(i,e))}(i,e))}whenTagged(i,e){return this.when(B(i,e))}whenNoAncestor(i){return this.when(M(i))}whenNoAncestorIs(i){return this.when(M(R(i)))}whenNoAncestorNamed(i){return this.when(function(i){return M(P(i))}(i))}whenNoAncestorTagged(i,e){return this.when(function(i,e){return M(B(i,e))}(i,e))}}class j extends k{#c;constructor(i){super(i),this.#c=new D(i)}onActivation(i){return this.#c.onActivation(i)}onDeactivation(i){return this.#c.onDeactivation(i)}}class E extends j{#d;constructor(i){super(i),this.#d=new O(i)}inRequestScope(){return this.#d.inRequestScope()}inSingletonScope(){return this.#d.inSingletonScope()}inTransientScope(){return this.#d.inTransientScope()}}const T=Symbol.for("@inversifyjs/container/InversifyContainerError");class V extends Error{[T];kind;constructor(i,e,t){super(e,t),this[T]=!0,this.kind=i}static is(i){return"object"==typeof i&&null!==i&&!0===i[T]}static isErrorOfKind(i,e){return V.is(i)&&i.kind===e}}var _;!function(i){i[i.invalidOperation=0]="invalidOperation"}(_||(_={}));const G=c.Transient;class q{#l;#u;#h;#v;#g;#b;#S;#p;#f;#m;constructor(i){this.#v=i=>this.#l.get(i),this.#S=new l,this.#p=this.#y(),void 0===i?.parent?(this.#l=u.build(void 0),this.#u=h.build(void 0),this.#h=v.build(void 0)):(this.#l=u.build(i.parent.#l),this.#u=h.build(i.parent.#u),this.#h=v.build(i.parent.#h),i.parent.#S.subscribe(this.#S)),this.#g=this.#u.get.bind(this.#u),this.#f=this.#w.bind(this),this.#b={autobind:i?.autobind??!1,defaultScope:i?.defaultScope??G},this.#m=[]}bind(i){return new F((i=>{this.#w(i)}),void 0,this.#b.defaultScope,i)}get(i,e){const t=this.#I(!1,i,e),n=this.#A(t);if(s(n))throw new V(_.invalidOperation,`Unexpected asyncronous service when resolving service "${a(i)}"`);return n}getAll(i,e){const t=this.#I(!0,i,e),n=this.#A(t);if(s(n))throw new V(_.invalidOperation,`Unexpected asyncronous service when resolving service "${a(i)}"`);return n}async getAllAsync(i,e){const t=this.#I(!0,i,e);return this.#A(t)}async getAsync(i,e){const t=this.#I(!1,i,e);return this.#A(t)}isBound(i,e){const t=this.#u.get(i);return this.#P(i,t,e)}isCurrentBound(i,e){const t=this.#u.getNonParentBindings(i);return this.#P(i,t,e)}async load(...i){await Promise.all(i.map((async i=>i.load(this.#R(i.id)))))}onActivation(i,e){this.#l.add(e,{serviceId:i})}onDeactivation(i,e){this.#h.add(e,{serviceId:i})}restore(){const i=this.#m.pop();if(void 0===i)throw new V(_.invalidOperation,"No snapshot available to restore");this.#l=i.activationService,this.#u=i.bindingService,this.#h=i.deactivationService,this.#B()}snapshot(){this.#m.push({activationService:this.#l.clone(),bindingService:this.#u.clone(),deactivationService:this.#h.clone()})}async unbind(i){await g(this.#C(),i),this.#l.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#h.removeAllByServiceId(i),this.#S.clearCache()}async unbindAll(){const i=this.#C(),e=[...this.#u.getNonParentBoundServices()];await Promise.all(e.map((async e=>g(i,e))));for(const i of e)this.#l.removeAllByServiceId(i),this.#u.removeAllByServiceId(i),this.#h.removeAllByServiceId(i);this.#S.clearCache()}async unload(...i){const e=this.#C();await Promise.all(i.map((i=>b(e,i.id))));for(const e of i)this.#l.removeAllByModuleId(e.id),this.#u.removeAllByModuleId(e.id),this.#h.removeAllByModuleId(e.id);this.#S.clearCache()}#R(i){return{bind:e=>new F((i=>{this.#w(i)}),i,this.#b.defaultScope,e),isBound:this.isBound.bind(this),onActivation:(e,t)=>{this.#l.add(t,{moduleId:i,serviceId:e})},onDeactivation:(e,t)=>{this.#h.add(t,{moduleId:i,serviceId:e})},unbind:this.unbind.bind(this)}}#C(){return{getBindings:i=>this.#u.get(i),getBindingsFromModule:i=>this.#u.getByModuleId(i),getClassMetadata:o,getDeactivations:i=>this.#h.get(i)}}#M(i,e,t){return{isMultiple:i,name:t?.name,optional:t?.optional,serviceIdentifier:e,tag:t?.tag}}#N(i,e,t){const n={autobindOptions:t?.autobind??this.#b.autobind?{scope:this.#b.defaultScope}:void 0,getBindings:this.#g,getClassMetadata:o,rootConstraints:{isMultiple:i,serviceIdentifier:e},servicesBranch:new Set,setBinding:this.#f};return this.#x(n,t),n}#I(i,e,t){const n=this.#M(i,e,t),s=this.#S.get(n);if(void 0!==s)return s;const a=S(this.#N(i,e,t));return this.#S.set(n,a),a}#y(){return{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}}#A(i){return p({context:this.#p,getActivations:this.#v,planResult:i,requestScopeCache:new Map})}#x(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}))}#P(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}#B(){this.#S.clearCache(),this.#v=i=>this.#l.get(i),this.#g=this.#u.get.bind(this.#u),this.#p=this.#y(),this.#f=this.#w.bind(this)}#w(i){this.#u.set(i),this.#S.clearCache()}}export{q as Container,m as ContainerModule,V as InversifyContainerError,_ as InversifyContainerErrorKind};
//# sourceMappingURL=index.js.map

@@ -9,4 +9,4 @@ {

"@inversifyjs/common": "1.5.0",
"@inversifyjs/core": "4.0.0",
"@inversifyjs/reflect-metadata-utils": "1.1.0"
"@inversifyjs/reflect-metadata-utils": "1.1.0",
"@inversifyjs/core": "4.0.0"
},

@@ -64,3 +64,3 @@ "devDependencies": {

},
"version": "1.5.1",
"version": "1.5.2",
"scripts": {

@@ -67,0 +67,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc