Comparing version 0.0.8 to 0.0.9
/// <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; |
28
index.js
/// <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 |
24
index.ts
@@ -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' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6027
12
132