Skip to content

Commit

Permalink
misc refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Apr 26, 2011
1 parent d8d23c0 commit 9be5992
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/router/index.js
Expand Up @@ -282,9 +282,9 @@ function match(req, routes, i) {
if (captures = path.exec(pathname)) {
fn.method = method;
fn.params = [];
for (var j = 1, len = captures.length; j < len; ++j) {
for (var j = 1, l = captures.length; j < l; ++j) {
var key = keys[j-1],
val = typeof captures[j] === 'string'
val = 'string' == typeof captures[j]
? decodeURIComponent(captures[j])
: captures[j];
if (key) {
Expand Down
1 change: 1 addition & 0 deletions lib/router/route.js
Expand Up @@ -26,6 +26,7 @@ function Route(method, path, fn) {
this.path = path;
this.regexp = normalize(path, this.keys = []);
this.method = method;
this.params = [];
}

/**
Expand Down

0 comments on commit 9be5992

Please sign in to comment.