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

@spinajs/di

Package Overview
Dependencies
Maintainers
1
Versions
260
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/di - npm Package Compare versions

Comparing version 1.2.20 to 1.2.26

20

lib/container.js

@@ -113,6 +113,10 @@ "use strict";

const emit = (target) => {
// firs event to emit that particular type was resolved
this.emit(`di.resolved.${(0, helpers_1.getTypeName)(target)}`, this, target);
// emit that source type was resolved
this.emit(`di.resolved.${sourceName}`, this, target);
// do not emit when we alrady created and cached value
// ( resolve happends only once eg. for singletons)
if (!this.Cache.has((0, helpers_1.getTypeName)(target))) {
// firs event to emit that particular type was resolved
this.emit(`di.resolved.${(0, helpers_1.getTypeName)(target)}`, this, target);
// emit that source type was resolved
this.emit(`di.resolved.${sourceName}`, this, target);
}
};

@@ -141,4 +145,4 @@ if (options === true || check === true) {

value.forEach((v) => {
emit(v);
setCache(v);
emit(v);
});

@@ -150,4 +154,4 @@ return value;

resolved.forEach((v) => {
emit(v);
setCache(v);
emit(v);
});

@@ -175,9 +179,9 @@ return resolved;

return rValue.then((v) => {
emit(v);
setCache(v);
emit(v);
return v;
});
}
emit(rValue);
setCache(rValue);
emit(rValue);
return rValue;

@@ -184,0 +188,0 @@ }

2

lib/decorators.js

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

autoinjectKey: propertyKey,
inject: isArray ? Array.ofType(injectType) : type,
inject: isArray ? Array.ofType(injectType) : injectType !== null && injectType !== void 0 ? injectType : type,
});

@@ -135,0 +135,0 @@ });

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

function isPromise(value) {
return Boolean(value && typeof value.then === 'function');
return value instanceof Promise;
}

@@ -38,0 +38,0 @@ exports.isPromise = isPromise;

{
"name": "@spinajs/di",
"version": "1.2.20",
"version": "1.2.26",
"description": "lightweight di container ",

@@ -46,3 +46,3 @@ "main": "lib/index.js",

},
"gitHead": "bbed041879adfd9d6a502aa27891a3682e68c20c"
"gitHead": "db0a4879ea356c677f78938201ddf93e032e1e63"
}

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