Comparing version 2.0.0 to 2.0.1
@@ -1,29 +0,13 @@ | ||
import Kernel from "./kernel/kernel"; | ||
import KernelModule from "./kernel/kernel_module"; | ||
import injectable from "./annotation/injectable"; | ||
import tagged from "./annotation/tagged"; | ||
import named from "./annotation/named"; | ||
import inject from "./annotation/inject"; | ||
import unmanaged from "./annotation/unmanaged"; | ||
import multiInject from "./annotation/multi_inject"; | ||
import targetName from "./annotation/target_name"; | ||
import { decorate } from "./annotation/decorator_utils"; | ||
import { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint } from "./syntax/constraint_helpers"; | ||
import guid from "./utils/guid"; | ||
import interfaces from "./interfaces/interfaces"; | ||
export { Kernel }; | ||
export { KernelModule }; | ||
export { decorate }; | ||
export { injectable }; | ||
export { tagged }; | ||
export { named }; | ||
export { inject }; | ||
export { unmanaged }; | ||
export { multiInject }; | ||
export { targetName }; | ||
export { traverseAncerstors }; | ||
export { taggedConstraint }; | ||
export { namedConstraint }; | ||
export { typeConstraint }; | ||
export { guid }; | ||
export { interfaces }; | ||
export { default as Kernel } from "./kernel/kernel"; | ||
export { default as KernelModule } from "./kernel/kernel_module"; | ||
export { default as injectable } from "./annotation/injectable"; | ||
export { default as tagged } from "./annotation/tagged"; | ||
export { default as named } from "./annotation/named"; | ||
export { default as inject } from "./annotation/inject"; | ||
export { default as unmanaged } from "./annotation/unmanaged"; | ||
export { default as multiInject } from "./annotation/multi_inject"; | ||
export { default as targetName } from "./annotation/target_name"; | ||
export { default as guid } from "./utils/guid"; | ||
export { default as interfaces } from "./interfaces/interfaces"; | ||
export { decorate } from "./annotation/decorator_utils"; | ||
export { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint } from "./syntax/constraint_helpers"; |
export var DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times."; | ||
export var DUPLICATED_METADATA = "Metadadata key was used more than once in a parameter:"; | ||
export var DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:"; | ||
export var NULL_ARGUMENT = "NULL argument"; | ||
@@ -4,0 +4,0 @@ export var KEY_NOT_FOUND = "Key Not Found"; |
@@ -1,27 +0,12 @@ | ||
import Kernel from "./kernel/kernel"; | ||
import KernelModule from "./kernel/kernel_module"; | ||
import injectable from "./annotation/injectable"; | ||
import tagged from "./annotation/tagged"; | ||
import named from "./annotation/named"; | ||
import inject from "./annotation/inject"; | ||
import unmanaged from "./annotation/unmanaged"; | ||
import multiInject from "./annotation/multi_inject"; | ||
import targetName from "./annotation/target_name"; | ||
import { decorate } from "./annotation/decorator_utils"; | ||
import { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint } from "./syntax/constraint_helpers"; | ||
import guid from "./utils/guid"; | ||
export { Kernel }; | ||
export { KernelModule }; | ||
export { decorate }; | ||
export { injectable }; | ||
export { tagged }; | ||
export { named }; | ||
export { inject }; | ||
export { unmanaged }; | ||
export { multiInject }; | ||
export { targetName }; | ||
export { traverseAncerstors }; | ||
export { taggedConstraint }; | ||
export { namedConstraint }; | ||
export { typeConstraint }; | ||
export { guid }; | ||
export { default as Kernel } from "./kernel/kernel"; | ||
export { default as KernelModule } from "./kernel/kernel_module"; | ||
export { default as injectable } from "./annotation/injectable"; | ||
export { default as tagged } from "./annotation/tagged"; | ||
export { default as named } from "./annotation/named"; | ||
export { default as inject } from "./annotation/inject"; | ||
export { default as unmanaged } from "./annotation/unmanaged"; | ||
export { default as multiInject } from "./annotation/multi_inject"; | ||
export { default as targetName } from "./annotation/target_name"; | ||
export { default as guid } from "./utils/guid"; | ||
export { decorate } from "./annotation/decorator_utils"; | ||
export { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint } from "./syntax/constraint_helpers"; |
export function getFunctionName(v) { | ||
return v.name ? v.name : v.toString().match(/^function\s*([^\s(]+)/)[1]; | ||
if (v.name) { | ||
return v.name; | ||
} | ||
else { | ||
var name_1 = v.toString(); | ||
var match = name_1.match(/^function\s*([^\s(]+)/); | ||
return match ? match[1] : "Anonymous function: " + name_1; | ||
} | ||
} |
"use strict"; | ||
exports.DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times."; | ||
exports.DUPLICATED_METADATA = "Metadadata key was used more than once in a parameter:"; | ||
exports.DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:"; | ||
exports.NULL_ARGUMENT = "NULL argument"; | ||
@@ -5,0 +5,0 @@ exports.KEY_NOT_FOUND = "Key Not Found"; |
@@ -20,2 +20,4 @@ "use strict"; | ||
exports.targetName = target_name_1.default; | ||
var guid_1 = require("./utils/guid"); | ||
exports.guid = guid_1.default; | ||
var decorator_utils_1 = require("./annotation/decorator_utils"); | ||
@@ -28,3 +30,1 @@ exports.decorate = decorator_utils_1.decorate; | ||
exports.typeConstraint = constraint_helpers_1.typeConstraint; | ||
var guid_1 = require("./utils/guid"); | ||
exports.guid = guid_1.default; |
"use strict"; | ||
function getFunctionName(v) { | ||
return v.name ? v.name : v.toString().match(/^function\s*([^\s(]+)/)[1]; | ||
if (v.name) { | ||
return v.name; | ||
} | ||
else { | ||
var name_1 = v.toString(); | ||
var match = name_1.match(/^function\s*([^\s(]+)/); | ||
return match ? match[1] : "Anonymous function: " + name_1; | ||
} | ||
} | ||
exports.getFunctionName = getFunctionName; |
{ | ||
"name": "inversify", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A powerful and lightweight inversion of control container for JavaScript and Node.js apps powered by TypeScript.", | ||
@@ -53,3 +53,3 @@ "main": "lib/inversify.js", | ||
"gulp-tslint": "^6.0.1", | ||
"gulp-typescript": "^2.13.0", | ||
"gulp-typescript": "^3.0.0", | ||
"gulp-uglify": "^2.0.0", | ||
@@ -56,0 +56,0 @@ "harmonize": "^1.4.4", |
@@ -60,9 +60,10 @@ # InversifyJS | ||
``` | ||
npm install inversify reflect-metadata --save | ||
$ npm install inversify reflect-metadata --save | ||
``` | ||
The InversifyJS type definitions are included in the inversify npm package. | ||
InversifyJS requires TypeScript 2.0 and the `experimentalDecorators`, `emitDecoratorMetadata`, `types` and `lib` | ||
compilation options in your `tsconfig.json` file: | ||
> **Important!** InversifyJS requires TypeScript >= 2.0 and the `experimentalDecorators`, `emitDecoratorMetadata`, `types` and `lib` | ||
compilation options in your `tsconfig.json` file. | ||
```js | ||
@@ -198,8 +199,8 @@ { | ||
var kernel = new Kernel(); | ||
kernel.bind<Warrior>(TYPES.Warrior).to(Ninja); | ||
kernel.bind<Weapon>(TYPES.Weapon).to(Katana); | ||
kernel.bind<ThrowableWeapon>(TYPES.ThrowableWeapon).to(Shuriken); | ||
var myKernel = new Kernel(); | ||
myKernel.bind<Warrior>(TYPES.Warrior).to(Ninja); | ||
myKernel.bind<Weapon>(TYPES.Weapon).to(Katana); | ||
myKernel.bind<ThrowableWeapon>(TYPES.ThrowableWeapon).to(Shuriken); | ||
export default kernel; | ||
export default myKernel; | ||
``` | ||
@@ -213,5 +214,5 @@ | ||
```ts | ||
import kernel = from "./inversify.config"; | ||
import myKernel from "./inversify.config"; | ||
var ninja = kernel.get<Warrior>(TYPES.Warrior); | ||
var ninja = myKernel.get<Warrior>(TYPES.Warrior); | ||
@@ -218,0 +219,0 @@ expect(ninja.fight()).eql("cut!"); // true |
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
285
174418
3538