Socket
Socket
Sign inDemoInstall

middleware-flow

Package Overview
Dependencies
6
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.0 to 0.5.1

.idea/.name

3

lib/try-catch.js

@@ -11,3 +11,4 @@ var series = require('./series');

else {
var mw = mwIf.apply(null, middlewares);
var middlewaresSeries = series.apply(null, middlewares);
var mw = mwIf(middlewaresSeries);
mw.catch = mw.else;

@@ -14,0 +15,0 @@ return mw;

{
"name": "middleware-flow",
"version": "0.5.0",
"version": "0.5.1",
"description": "Middleware control flow library: series, parallel, or, and",

@@ -27,3 +27,3 @@ "main": "index.js",

"dependencies": {
"101": "^0.3.0",
"101": "^0.6.0",
"callback-count": "0.0.3"

@@ -30,0 +30,0 @@ },

@@ -97,2 +97,37 @@ var createCount = require('callback-count');

});
it('should pass error to first mw catch', function (done) {
var app = createAppWithMiddleware(
flow
.try(nextErr(new Error('boom')))
.catch(
function(err, req, res, next) {
res.send('caught');
}
),
res.send('nocaught')
);
request(app)
.get('/')
.expect('caught')
.end(done);
});
it('should pass error to first mw catch', function (done) {
var app = createAppWithMiddleware(
flow
.try(
flow.next,
nextErr(new Error('boom'))
)
.catch(
function(err, req, res, next) {
res.send('caught');
}
),
res.send('nocaught')
);
request(app)
.get('/')
.expect('caught')
.end(done);
});
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc