Skip to content
Myr

renamed Router#_match() -> match()

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 6dac874 · Browse files · 1 file+19 added−19 removed
This commit

State

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

Diff stats

1 file+19 added−19 removed

  • other:+19 added−19 removed

1 file+19 added−19 removed

modified:lib/router/index.js+19 added-19 removed
140 unmodified lines
141 || method == 'all');142 });143};144145/**146 * Return routes with regexps that match the given `url`.147 *148 * @param {String} method149 * @param {String} url150 * @return {Collection}151 * @api public152 */145// /**146// * Return routes with regexps that match the given `url`.147// *148// * @param {String} method149// * @param {String} url150// * @return {Collection}151// * @api public152// */153// 154// Router.prototype.match = function(method, url){155// return this.find(function(route){156// return route.match(url)157// && (route.method == method158// || method == 'all');159// });160// };161154Router.prototype.match = function(method, url){155 return this.find(function(route){156 return route.match(url)157 && (route.method == method158 || method == 'all');159 });160};161162/**163 * Find routes based on the return value of `fn`164 * which is invoked once per route.165 *
50 unmodified lines
216 pass(req._route_index + 1, err);217 }218219 // match route220 req.route = route = self._match(req, i);220 req.route = route = self.match(req, i);221222 // implied OPTIONS223 if (!route && 'OPTIONS' == req.method) return self._options(req, res);224
106 unmodified lines
331 * @return {Route}332 * @api private333 */334335Router.prototype._match = function(req, i, head){335Router.prototype.match = function(req, i, head){336 var method = req.method.toLowerCase()337 , url = parse(req.url)338 , path = url.pathname339 , routes = this.map
4 unmodified lines
344 // HEAD support345 // TODO: clean this up346 if (!head && 'head' == method) {347 // attempt lookup348 route = this._match(req, i, true);348 route = this.match(req, i, true);349 if (route) return route;350351 // default to GET as res.render() / res.send()352 // etc support HEAD
63 unmodified lines