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

typedi

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedi - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

Service.js

14

Container.js

@@ -11,2 +11,5 @@ require('reflect-metadata');

};
Container.registerDefaultInitializationParameter = function (type, params) {
this.defaultParameters.push({ type: type, params: params });
};
Container.get = function (type, params) {

@@ -16,2 +19,7 @@ var obj = this.findInstanceOfType(type);

return obj;
if (!params) {
var defaultParams = this.defaultParameters.reduce(function (found, i) { return i.type === type ? i : found; }, undefined);
if (defaultParams)
params = defaultParams.params;
}
if (params) {

@@ -25,2 +33,5 @@ params = this.mapParams(type, params);

};
Container.set = function (type, value) {
this.instances.push({ type: type, instance: value });
};
// -------------------------------------------------------------------------

@@ -41,3 +52,3 @@ // Private Static Methods

return paramHandler.getValue();
return Container.get(param, Reflect.getMetadata('design:paramtypes', param));
return Container.get(param); //, Reflect.getMetadata('design:paramtypes', param));
});

@@ -50,4 +61,5 @@ };

Container.customParamHandlers = [];
Container.defaultParameters = [];
return Container;
})();
exports.Container = Container;

2

package.json
{
"name": "typedi",
"version": "0.0.4",
"version": "0.0.5",
"description": "Dependancy injection for Typescript",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -12,6 +12,9 @@ declare module 'typedi/Container' {

export class Container {
static instances: Instance[];
static customParamHandlers: CustomParamHandler[];
private static instances;
private static customParamHandlers;
private static defaultParameters;
static registerCustomParamHandler(paramHandler: CustomParamHandler): void;
static registerDefaultInitializationParameter(type: Function, params?: any[]): void;
static get<T>(type: Function, params?: any[]): T;
static set(type: Function, value: any): void;
private static findInstanceOfType(type);

@@ -35,1 +38,5 @@ private static findCustomParamHandler(type, index);

}
declare module 'typedi/Service' {
export function Service(): (target: Function) => void;
}
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