Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

Commit

Permalink
return this, #13
Browse files Browse the repository at this point in the history
  • Loading branch information
joesonw committed Aug 14, 2017
1 parent 8fd03b8 commit 644ba06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@t2ee/vader",
"version": "1.0.2",
"version": "1.0.3",
"description": "t2ee router component",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
7 changes: 5 additions & 2 deletions src/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class Router {
beforeOrAfter?: AfterMiddleware[] | BeforeMiddleware[],
aftersOrAfterAlls?: AfterMiddleware[] | AfterAllMiddleware[],
afterAlls: AfterAllMiddleware[] = [],
): void {
): Router {
if (Array.isArray(klassOrBefores)) {
this.useMiddlewares(klassOrBefores, <AfterMiddleware[]> beforeOrAfter);

Expand Down Expand Up @@ -327,6 +327,8 @@ class Router {
}

this.controllers.push(controller);

return this;
}

public static newInstance(): Router {
Expand All @@ -335,8 +337,9 @@ class Router {
return router;
}

public provideContext<T>(klass: ClassConstructor<T>, func: (req: Request) => T): void {
public provideContext<T>(klass: ClassConstructor<T>, func: (req: Request) => T): Router{
this.contextedVariables.set(klass, func);
return this;
}

}
Expand Down

0 comments on commit 644ba06

Please sign in to comment.