Skip to content

Commit db09917

Browse files
author
jeff
committed
Release 2.4.0. Expose a list of Routes that have participated in handling the event to the postProcess function. (ie: the signature is now postProcess(evt: RouterEvent, resp: RouterResponse) => Promise<RouterResponse | null | void> | RouterResponse | null | void;) Fixed Route.enabled=false not functioning.
1 parent 516a71f commit db09917

File tree

6 files changed

+124
-98
lines changed

6 files changed

+124
-98
lines changed

package-lock.json

Lines changed: 93 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cassava",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "AWS API Gateway Router",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -37,22 +37,22 @@
3737
},
3838
"homepage": "https://github.com/Giftbit/cassava#readme",
3939
"devDependencies": {
40-
"@types/aws-lambda": "^8.10.13",
41-
"@types/chai": "^4.1.6",
42-
"@types/cookie": "^0.3.1",
40+
"@types/aws-lambda": "^8.10.17",
41+
"@types/chai": "^4.1.7",
42+
"@types/cookie": "^0.3.2",
4343
"@types/mocha": "^5.2.5",
4444
"@types/negotiator": "^0.6.1",
45-
"@types/node": "^10.12.0",
45+
"@types/node": "^10.12.18",
4646
"@types/uuid": "^3.4.4",
4747
"chai": "^4.2.0",
4848
"gh-pages": "^2.0.1",
4949
"mocha": "^5.2.0",
50-
"rimraf": "^2.6.2",
50+
"rimraf": "^2.6.3",
5151
"touch": "^3.1.0",
5252
"ts-node": "^7.0.1",
53-
"tslint": "^5.11.0",
54-
"typedoc": "^0.13.0",
55-
"typescript": "^3.1.3"
53+
"tslint": "^5.12.0",
54+
"typedoc": "^0.14.0",
55+
"typescript": "^3.2.2"
5656
},
5757
"dependencies": {
5858
"cookie": "^0.3.1",

src/Router.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ describe("Router", () => {
4646
});
4747

4848
router.route("/foo/bar")
49-
.postProcessor(async (evt, resp) => {
49+
.postProcessor(async (evt, resp, handlers) => {
50+
chai.assert.lengthOf(handlers, 2);
5051
resp.body.processor1 = "done";
5152
return resp;
5253
});
5354

5455
router.route("/foo/bar")
55-
.postProcessor(async (evt, resp) => {
56+
.postProcessor(async (evt, resp, handlers) => {
57+
chai.assert.lengthOf(handlers, 1);
5658
resp.body.processor1 = "not done";
5759
resp.body.processor2 = "done";
5860
return resp;

0 commit comments

Comments
 (0)