middleware-flow
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -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); | ||
}); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
73987
37
1131
+ Added101@0.6.0(transitive)
+ Addedclone@0.1.19(transitive)
- Removed101@0.3.4(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedassertion-error@1.0.0(transitive)
- Removedasync@0.2.100.8.0(transitive)
- Removedchai@1.10.0(transitive)
- Removeddiff@1.4.0(transitive)
- Removedesprima@1.2.5(transitive)
- Removedhandlebars@1.3.0(transitive)
- Removedlab@3.1.4(transitive)
- Removedminimist@0.0.10(transitive)
- Removedoptimist@0.3.70.6.1(transitive)
- Removedsource-map@0.1.43(transitive)
- Removeduglify-js@2.3.6(transitive)
- Removedwordwrap@0.0.3(transitive)
Updated101@^0.6.0