Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "ware", | ||
"repo": "segmentio/ware", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"license": "MIT", | ||
@@ -10,3 +10,3 @@ "description": "Easily create your own middleware layer.", | ||
"connect", | ||
"express" | ||
"express", | ||
"layer", | ||
@@ -17,2 +17,2 @@ "middleware" | ||
"main": "lib/index.js" | ||
} | ||
} |
@@ -0,1 +1,5 @@ | ||
0.2.1 - December 12, 2013 | ||
------------------------- | ||
* fix skipping error handlers without error | ||
0.2.0 - October 18, 2013 | ||
@@ -2,0 +6,0 @@ ------------------------ |
@@ -8,3 +8,2 @@ | ||
/** | ||
@@ -19,3 +18,2 @@ * Initialize a new `Ware` manager. | ||
/** | ||
@@ -33,3 +31,2 @@ * Use a middleware `fn`. | ||
/** | ||
@@ -55,3 +52,5 @@ * Run through the middleware with the given `args` and optional `callback`. | ||
if (!fn) return callback && callback.apply(null, [err].concat(args)); | ||
if (fn.length < args.length + 2 && err) return next(err); | ||
if (fn.length == args.length + 2 && !err) return next(); | ||
@@ -58,0 +57,0 @@ var arr = [].slice.call(args); |
{ | ||
"name": "ware", | ||
"repository":"git://github.com/segmentio/ware.git", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "description": "Easily create your own middleware layer.", |
@@ -0,1 +1,2 @@ | ||
# ware | ||
@@ -2,0 +3,0 @@ |
@@ -73,3 +73,3 @@ | ||
.use(function (next) { next(new Error()); }) | ||
.use(function (next) { assert(false); next(); }) | ||
.use(function (next) { assert(false); }) | ||
.run(function (err) { | ||
@@ -81,2 +81,12 @@ assert(err); | ||
it('should skip error handlers on no error', function (done) { | ||
ware() | ||
.use(function (next) { next(); }) | ||
.use(function (err, next) { assert(false); }) | ||
.run(function (err) { | ||
assert(!err); | ||
done(); | ||
}); | ||
}); | ||
it('should call error middleware on error', function (done) { | ||
@@ -83,0 +93,0 @@ var errors = 0; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7878
161
84
0