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.8 to 0.0.9

di-ts.d.ts

9

index.d.ts
/// <reference path="di.d.ts" />
import * as di from 'di';
export declare var Injector: typeof di.Injector;
export declare function Inject(classFunc: any): void;
export declare function Provide(targetClassFunc: any): (classFunc: any) => void;
declare module diTS {
var Injector: typeof di.Injector;
function Inject(classFunc: any): void;
function Provide(targetClassFunc: any): (classFunc: any) => void;
}
export = diTS;
/// <reference path="./di.d.ts"/>
require('reflect-metadata');
var di = require('di');
exports.Injector = di.Injector;
function Inject(classFunc) {
var dependencies = Reflect.getMetadata("design:paramtypes", classFunc) || [];
di.annotate.apply(di, [classFunc].concat(dependencies.map(function (dep) { return new di.Inject(dep); })));
}
exports.Inject = Inject;
function Provide(targetClassFunc) {
return function (classFunc) {
di.annotate(classFunc, new di.Provide(targetClassFunc));
};
}
exports.Provide = Provide;
var diTS;
(function (diTS) {
diTS.Injector = di.Injector;
function Inject(classFunc) {
var dependencies = Reflect.getMetadata("design:paramtypes", classFunc) || [];
di.annotate.apply(di, [classFunc].concat(dependencies.map(function (dep) { return new di.Inject(dep); })));
}
diTS.Inject = Inject;
function Provide(targetClassFunc) {
return function (classFunc) {
di.annotate(classFunc, new di.Provide(targetClassFunc));
};
}
diTS.Provide = Provide;
})(diTS || (diTS = {}));
module.exports = diTS;
//# sourceMappingURL=index.js.map

@@ -9,14 +9,20 @@

export var Injector = di.Injector;
module diTS {
export function Inject(classFunc: any) {
const dependencies = Reflect.getMetadata("design:paramtypes", classFunc) || [];
(<any>di).annotate.apply(di, [classFunc].concat(dependencies.map((dep: any) => new (<any>di).Inject(dep))));
}
export var Injector = di.Injector;
export function Provide(targetClassFunc: any) {
return function (classFunc: any) {
(<any>di).annotate(classFunc, new (<any>di).Provide(targetClassFunc));
};
export function Inject(classFunc: any) {
const dependencies = Reflect.getMetadata("design:paramtypes", classFunc) || [];
(<any>di).annotate.apply(di, [classFunc].concat(dependencies.map((dep: any) => new (<any>di).Inject(dep))));
}
export function Provide(targetClassFunc: any) {
return function (classFunc: any) {
(<any>di).annotate(classFunc, new (<any>di).Provide(targetClassFunc));
};
}
}
export = diTS;
{
"name": "di-ts",
"version": "0.0.8",
"version": "0.0.9",
"description": "Lightweight wrap and extension of angular/di.js for TypeScript.",

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

@@ -35,3 +35,3 @@

```typescript
/// <reference path="node_modules/di-ts/index.d.ts"/>
/// <reference path="node_modules/di-ts/di-ts.d.ts"/>

@@ -38,0 +38,0 @@ import {Injector} from 'di-ts'

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