Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@travetto/di

Package Overview
Dependencies
Maintainers
1
Versions
313
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/di - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

package.json

@@ -22,3 +22,3 @@ {

},
"version": "0.0.5"
"version": "0.0.6"
}

@@ -20,2 +20,4 @@ import { Dependency, InjectableConfig, ClassTarget } from '../types';

private instances = new Map<TargetId, Map<string, any>>();
private instancePromises = new Map<TargetId, Map<string, Promise<any>>>();
private aliases = new Map<TargetId, Map<string, string>>();

@@ -119,3 +121,2 @@ private targets = new Map<ClassId, Map<string, TargetId>>();

private async createInstance<T>(target: ClassTarget<T>, name: string = DEFAULT_INSTANCE) {
let instance = await this.construct(target, name);
let targetId = target.__id;

@@ -125,4 +126,14 @@

this.instances.set(targetId, new Map());
this.instancePromises.set(targetId, new Map());
}
if (this.instancePromises.get(targetId)!.has(name)) {
return this.instancePromises.get(targetId)!.get(name);
}
let instancePromise = this.construct(target, name);
this.instancePromises.get(targetId)!.set(name, instancePromise);
let instance = await instancePromise;
if (AppEnv.watch) {

@@ -288,2 +299,3 @@ if (!this.proxies.has(targetId)) {

this.instances.get(targetId)!.delete(config);
this.instancePromises.get(targetId)!.delete(config);
console.debug('On uninstall', cls.__id, config, targetId, handler);

@@ -299,2 +311,3 @@ this.targets.get(cls.__id)!.delete(config);

this.instances.clear();
this.instancePromises.clear();
this.proxies.clear();

@@ -301,0 +314,0 @@ this.proxyHandlers.clear();

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