Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
remojansen committed Apr 6, 2017
1 parent ace36cc commit bd16e7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inversify-express-utils",
"version": "3.5.0",
"version": "3.5.1",
"description": "Some utilities for the development of express applications with Inversify",
"main": "lib/index.js",
"jsnext:main": "es/index.js",
Expand Down Expand Up @@ -40,7 +40,7 @@
"gulp-mocha": "^4.0.1",
"gulp-tslint": "^7.0.1",
"gulp-typescript": "^3.1.3",
"inversify": "^3.2.0",
"inversify": "^3.3.0",
"mocha": "^3.2.0",
"publish-please": "^2.2.0",
"reflect-metadata": "^0.1.8",
Expand Down
7 changes: 3 additions & 4 deletions src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,14 @@ export function Params(type: PARAMETER_TYPE, parameterName: string) {
};
if (!Reflect.hasOwnMetadata(METADATA_KEY.controllerParameter, target.constructor)) {
parameterMetadataList.unshift(parameterMetadata);
metadataList[methodName] = parameterMetadataList;
Reflect.defineMetadata(METADATA_KEY.controllerParameter, metadataList, target.constructor);
} else {
metadataList = Reflect.getOwnMetadata(METADATA_KEY.controllerParameter, target.constructor);
if (metadataList.hasOwnProperty(methodName)) {
parameterMetadataList = metadataList[methodName];
}
parameterMetadataList.unshift(parameterMetadata);
}

metadataList[methodName] = parameterMetadataList;
Reflect.defineMetadata(METADATA_KEY.controllerParameter, metadataList, target.constructor);
};
};
}

0 comments on commit bd16e7a

Please sign in to comment.