diff --git a/README.md b/README.md index 00fd2e162..77813d743 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ InversifyJS has been developed with 4 main goals: You can get the latest release and the type definitions using npm: ``` -npm install inversify@2.0.0-beta.10 reflect-metadata --save +npm install inversify@2.0.0-rc.1 reflect-metadata --save npm install inversify-dts --save-dev ``` diff --git a/package.json b/package.json index e37f854f8..afd6b615e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inversify", - "version": "2.0.0-beta.10", + "version": "2.0.0-rc.1", "description": "A lightweight IoC container written in TypeScript.", "main": "lib/inversify.js", "jsnext:main": "es/inversify.js", diff --git a/src/interfaces/interfaces.ts b/src/interfaces/interfaces.ts index 5d97d6ac7..1879fb49a 100644 --- a/src/interfaces/interfaces.ts +++ b/src/interfaces/interfaces.ts @@ -169,6 +169,7 @@ namespace interfaces { export interface KeyValuePair { serviceIdentifier: ServiceIdentifier; value: Array; + guid: string; } export interface BindingInSyntax { diff --git a/src/inversify.ts b/src/inversify.ts index c56b8a749..bcfb86567 100644 --- a/src/inversify.ts +++ b/src/inversify.ts @@ -13,6 +13,7 @@ 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 { makePropertyInjectDecorator, makePropertyMultiInjectDecorator, @@ -37,3 +38,4 @@ export { traverseAncerstors }; export { taggedConstraint }; export { namedConstraint }; export { typeConstraint }; +export { guid }; diff --git a/src/kernel/key_value_pair.ts b/src/kernel/key_value_pair.ts index 909f71a41..f76b42acb 100644 --- a/src/kernel/key_value_pair.ts +++ b/src/kernel/key_value_pair.ts @@ -1,14 +1,17 @@ import interfaces from "../interfaces/interfaces"; +import guid from "../utils/guid"; class KeyValuePair implements interfaces.KeyValuePair { public serviceIdentifier: (string|Symbol|any); public value: Array; + public guid: string; public constructor(serviceIdentifier: (string|Symbol|any), value: T) { this.serviceIdentifier = serviceIdentifier; this.value = new Array(); this.value.push(value); + this.guid = guid(); } } diff --git a/test/kernel/key_value_pair.test.ts b/test/kernel/key_value_pair.test.ts index afe47b9d3..d10bb5f6a 100644 --- a/test/kernel/key_value_pair.test.ts +++ b/test/kernel/key_value_pair.test.ts @@ -9,6 +9,7 @@ describe("KeyValuePair", () => { expect(keyValuePair.serviceIdentifier).eql("test"); expect(keyValuePair.value.length).eql(1); expect(keyValuePair.value[0]).eql(1); + expect(keyValuePair.guid.length).eql(36); });