Skip to content
Myr

deps: path-to-regexp@0.1.8 (#5603)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Blake Embrey · committed by GitHub · parent e35380a · Browse files · 3 files+29 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+29 added−1 removed

  • tests:+26 added−0 removed
  • other:+3 added−1 removed

3 files+29 added−1 removed

modified:test/app.router.js+26 added
191 unmodified lines
192 .get('/user/10/edit')193 .expect('editing user 10', done);194 })195196 if (supportsRegexp('(?<foo>.*)')) {197 it('should populate req.params with named captures', function(done){198 var app = express();199 var re = new RegExp('^/user/(?<userId>[0-9]+)/(view|edit)?$');200201 app.get(re, function(req, res){202 var id = req.params.userId203 , op = req.params[0];204 res.end(op + 'ing user ' + id);205 });206207 request(app)208 .get('/user/10/edit')209 .expect('editing user 10', done);210 })211 }212213 it('should ensure regexp matches path prefix', function (done) {214 var app = express()215 var p = []216
913 unmodified lines
1130 var app = express();1131 assert.strictEqual(app.get('/', function () {}), app)1132 })1133})11341135function supportsRegexp(source) {1136 try {1137 new RegExp(source)1138 return true1139 } catch (e) {1140 return false1141 }1142}
modified:History.md+2 added
1unreleased2==========34 * deps: path-to-regexp@0.1.85 - Adds support for named matching groups in the routes using a regex6 * deps: encodeurl@~2.0.07 - Removes encoding of `\`, `|`, and `^` to align better with URL spec8 * Deprecate passing `options.maxAge` and `options.expires` to `res.clearCookie`9 - Will be ignored in v5, clearCookie will set a cookie with an expires in the past to instruct clients to delete the cookie
3616 unmodified lines
modified:package.json+1 added-1 removed