Skip to content

Commit

Permalink
Implemented #272 (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
remojansen authored Jun 25, 2016
1 parent fe6f296 commit 7e255f3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]beta.10 reflect-metadata --save
npm install [email protected]rc.1 reflect-metadata --save
npm install inversify-dts --save-dev
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ namespace interfaces {
export interface KeyValuePair<T> {
serviceIdentifier: ServiceIdentifier<any>;
value: Array<T>;
guid: string;
}

export interface BindingInSyntax<T> {
Expand Down
2 changes: 2 additions & 0 deletions src/inversify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -37,3 +38,4 @@ export { traverseAncerstors };
export { taggedConstraint };
export { namedConstraint };
export { typeConstraint };
export { guid };
3 changes: 3 additions & 0 deletions src/kernel/key_value_pair.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import interfaces from "../interfaces/interfaces";
import guid from "../utils/guid";

class KeyValuePair<T> implements interfaces.KeyValuePair<T> {

public serviceIdentifier: (string|Symbol|any);
public value: Array<T>;
public guid: string;

public constructor(serviceIdentifier: (string|Symbol|any), value: T) {
this.serviceIdentifier = serviceIdentifier;
this.value = new Array<T>();
this.value.push(value);
this.guid = guid();
}
}

Expand Down
1 change: 1 addition & 0 deletions test/kernel/key_value_pair.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

});

Expand Down

0 comments on commit 7e255f3

Please sign in to comment.