Skip to content

Commit

Permalink
Fix signature of InjectFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Feb 6, 2019
1 parent b673e07 commit 4dcd700
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/di/src/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function Inject(dependency?: ServiceIdentifier<any>) {
};
}
export function InjectFunction<Dependencies extends Array<ServiceIdentifier<any>>, Fn extends (...args: Instances<Dependencies>) => any>(...dependencies: Dependencies) {
return (target: Fn): (...args: any[]) => ReturnType<Fn> => {
return (target: Fn): any => {
Reflect.defineMetadata(DESIGN_PARAM_TYPES, dependencies, target);
return target;
};
Expand Down
3 changes: 2 additions & 1 deletion packages/di/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"downlevelIteration": true
"downlevelIteration": true,
"strictFunctionTypes": true
},
"files": ["src/index.ts"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit 4dcd700

Please sign in to comment.