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

mesh-ioc

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mesh-ioc - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

2

out/main/proxy.d.ts
import { ServiceKey } from './types.js';
export type ServiceProxy<T> = T;
export declare function dependency<T>(thisArg: any, serviceKey: ServiceKey<T>): T;
export declare function dependency<T>(thisArg: any, serviceKey: ServiceKey<T>, cache?: boolean): T;
import { MESH_REF } from './mesh.js';
export function dependency(thisArg, serviceKey) {
const handler = new Proxy({}, {
get(_target, trap) {
return function (_target, ...args) {
const instance = thisArg[MESH_REF].resolve(serviceKey);
return Reflect[trap](instance, ...args);
};
}
});
const PROXY_TRAPS = Object.getOwnPropertyNames(Reflect);
export function dependency(thisArg, serviceKey, cache = true) {
let cachedInstance;
const handler = {};
for (const trap of PROXY_TRAPS) {
handler[trap] = function (_target, ...args) {
let instance = cachedInstance;
if (!instance) {
instance = thisArg[MESH_REF].resolve(serviceKey);
}
if (cache) {
cachedInstance = instance;
}
return Reflect[trap](instance, ...args);
};
}
return new Proxy(thisArg, handler);
}
//# sourceMappingURL=proxy.js.map
{
"name": "mesh-ioc",
"version": "4.0.1",
"version": "4.1.0",
"description": "Powerful and Lightweight IoC Library",

@@ -42,3 +42,3 @@ "type": "module",

"devDependencies": {
"@nodescript/eslint-config": "^2.0.2",
"@nodescript/eslint-config": "^2.0.3",
"@types/mocha": "^10.0.10",

@@ -45,0 +45,0 @@ "@types/node": "^22.10.2",

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