Comparing version 0.0.9 to 0.0.10
/// <reference path="index.d.ts"/> | ||
declare module "di-ts" { | ||
import diTS from "./index" | ||
export = diTS | ||
export var Injector: typeof di.Injector; | ||
export function Inject(classFunc: any): void; | ||
export function Provide(targetClassFunc: any): (classFunc: any) => void; | ||
} |
/// <reference path="di.d.ts" /> | ||
import * as di from 'di'; | ||
declare module diTS { | ||
var Injector: typeof di.Injector; | ||
function Inject(classFunc: any): void; | ||
function Provide(targetClassFunc: any): (classFunc: any) => void; | ||
} | ||
export = diTS; | ||
export declare var Injector: typeof di.Injector; | ||
export declare function Inject(classFunc: any): void; | ||
export declare function Provide(targetClassFunc: any): (classFunc: any) => void; |
28
index.js
/// <reference path="./di.d.ts"/> | ||
require('reflect-metadata'); | ||
var di = require('di'); | ||
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; | ||
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; | ||
//# sourceMappingURL=index.js.map |
26
index.ts
@@ -1,2 +0,1 @@ | ||
/// <reference path="./di.d.ts"/> | ||
@@ -7,22 +6,19 @@ | ||
declare var Reflect: any; | ||
declare | ||
var Reflect: any; | ||
module diTS { | ||
export var Injector = di.Injector; | ||
export var Injector = di.Injector; | ||
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 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 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.9", | ||
"version": "0.0.10", | ||
"description": "Lightweight wrap and extension of angular/di.js for TypeScript.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
6002
125