Skip to content
Myr

moved fn.params to route.params

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 83c2c17 · Browse files · 2 files+6 added−6 removed
This commit

State

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

Diff stats

2 files+6 added−6 removed

  • other:+6 added−6 removed

2 files+6 added−6 removed

modified:lib/router/index.js+6 added-5 removed
97 unmodified lines
98 if (route = match(req, routes, i)) {99 var i = 0100 , keys = route.keys;101102 req.params = route.callback.params;102 req.params = route.params;103104 // Param preconditions105 (function param(err) {106 try {
177 unmodified lines
284 var route = routes[i]285 , fn = route.callback286 , path = route.regexp287 , keys = route.keys;288289 // match290 if (captures = path.exec(pathname)) {289 fn.method = method;290 fn.params = [];291 route.params = [];292 for (var j = 1, l = captures.length; j < l; ++j) {293 var key = keys[j-1],294 val = 'string' == typeof captures[j]295 ? decodeURIComponent(captures[j])296 : captures[j];297 if (key) {297 fn.params[key] = val;298 route.params[key] = val;299 } else {299 fn.params.push(val);300 route.params.push(val);301 }302 }303 req._route_index = i;304 return route;
4 unmodified lines
modified:lib/router/route.js-1 removed