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

di-ts

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

di-ts - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

11

di.d.ts

@@ -15,2 +15,13 @@

export class Inject {
constructor(injectableClass: IClassInterface<any>);
}
export class Provide {
constructor(providedClass: IClassInterface<any>);
}
export function annotate<T>(classFunc: IClassInterface<T>, ...dependencies: Inject[]): void;
export function annotate<T>(classFunc: IClassInterface<T>, ...dependencies: Provide[]): void;
}

@@ -17,0 +28,0 @@

4

index.js

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

/// <reference path="node_modules/reflect-metadata/reflect-metadata.d.ts"/>
/// <reference path="./di.d.ts"/>

@@ -7,3 +8,4 @@ require('reflect-metadata');

var dependencies = Reflect.getMetadata("design:paramtypes", classFunc) || [];
di.annotate.apply(di, [classFunc].concat(dependencies.map(function (dep) { return new di.Inject(dep); })));
var annotateArgs = [classFunc].concat(dependencies.map(function (dep) { return new di.Inject(dep); }));
di.annotate.apply(di, annotateArgs);
}

@@ -10,0 +12,0 @@ exports.Inject = Inject;

@@ -0,1 +1,3 @@

/// <reference path="node_modules/reflect-metadata/reflect-metadata.d.ts"/>
/// <reference path="./di.d.ts"/>

@@ -6,6 +8,3 @@

declare
var Reflect: any;
export var Injector = di.Injector;

@@ -15,3 +14,4 @@

const dependencies = Reflect.getMetadata("design:paramtypes", classFunc) || [];
(<any>di).annotate.apply(di, [classFunc].concat(dependencies.map((dep: any) => new (<any>di).Inject(dep))));
var annotateArgs = [classFunc].concat(dependencies.map((dep: any) => new di.Inject(dep)));
di.annotate.apply(di, annotateArgs);
}

@@ -21,3 +21,3 @@

return function (classFunc: any) {
(<any>di).annotate(classFunc, new (<any>di).Provide(targetClassFunc));
di.annotate(classFunc, new di.Provide(targetClassFunc));
};

@@ -24,0 +24,0 @@ }

{
"name": "di-ts",
"version": "0.0.16",
"version": "0.0.17",
"description": "Lightweight wrap and extension of angular/di.js for TypeScript.",

@@ -5,0 +5,0 @@ "main": "index.js",

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