Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dispatch

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dispatch - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

7

lib/dispatch.js

@@ -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');
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc