Skip to content

Commit

Permalink
Renaming req.next() to req.last(), updating travis-ci.org config
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Oct 24, 2019
1 parent 9ab2598 commit 21cbcc0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- node
- 12
- 10
- 9
- 8

branches:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ Sends an error response.
##### res.header (key, value)
Shorthand of `res.setHeader()`.

##### res.next (req, res, next)
Last middleware of the route for the HTTP method as a way to "skip" to the middleware which sends a response.

##### res.json (body, [status = 200, headers])
Sends a JSON response.

##### res.last (req, res, next)
Last middleware of the route for the HTTP method as a way to "skip" to the middleware which sends a response.

##### res.redirect (uri[, perm = false])
Sends a redirection response.

Expand Down
2 changes: 1 addition & 1 deletion lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function reduce (uri, map = new Map(), arg = {}, end = false) {
arg.middleware = [...arg.middleware, ...i[1].handlers];

if (end) {
arg.next = arg.middleware[arg.middleware.length - 1];
arg.last = arg.middleware[arg.middleware.length - 1];
}

if (i[1].pos.length > 0 && arg.pos.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/woodland.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class Woodland extends EventEmitter {
params(req, result.pos);
}

req.next = result.next;
req.last = result.last;
next(req, res, e, result.middleware[Symbol.iterator]())();
} else {
last(req, res, e);
Expand Down

0 comments on commit 21cbcc0

Please sign in to comment.