express-conditional-middleware
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -36,3 +36,3 @@ 'use strict'; | ||
const nextOnce = once(next); | ||
if (condition === true || (typeof condition === 'function' && condition(req, res, nextOnce))) { | ||
if (condition === true || (typeof condition === 'function' && condition(req, res, nextOnce, ...rest))) { | ||
return success(req, res, nextOnce, ...rest); | ||
@@ -39,0 +39,0 @@ } |
@@ -40,3 +40,3 @@ { | ||
}, | ||
"version": "2.1.0" | ||
"version": "2.1.1" | ||
} |
@@ -75,2 +75,13 @@ 'use strict'; | ||
funcAdditional(test) { | ||
const conditionFunc = (req, res, next, extra) => extra === true; | ||
const middleware = conditional(conditionFunc, (req, res, next) => { | ||
test.ok(true, 'Conditional function returned true.'); | ||
next(); | ||
}); | ||
middleware({ working: true }, {}, () => test.done(), true); | ||
}, | ||
funcOnce(test) { | ||
@@ -77,0 +88,0 @@ test.expect(2); |
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
130750
151