Comparing version 1.0.0 to 1.0.1
@@ -63,7 +63,7 @@ var url = require('url'); | ||
return function (req, res, next) { | ||
var args = [req, res]; | ||
var args = [req, res], isSome; | ||
if (next) { | ||
args.push(next); | ||
} | ||
if(!compiled.some(function(x){ | ||
isSome = compiled.some(function(x){ | ||
var match = x[0].exec(url.parse(req.url).pathname); | ||
@@ -77,4 +77,5 @@ if (match) { | ||
return false; | ||
})) next(); | ||
}); | ||
if (!isSome && next) next(); | ||
}; | ||
}; |
@@ -6,3 +6,3 @@ { | ||
"author": "Caolan McMahon", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -275,1 +275,14 @@ var dispatch = require('../lib/dispatch'); | ||
}; | ||
exports['with named param at end'] = function (test) { | ||
var request = {url: '/tests/123', method: 'GET'}; | ||
dispatch({ | ||
'GET /tests/:x': function(req, res, x){ | ||
test.equals(req, request); | ||
test.equals(res, 'response'); | ||
test.equals(x, '123'); | ||
test.done(); | ||
} | ||
})(request, 'response'); | ||
}; | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
345
0
16709
6