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

express-conditional-middleware

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-conditional-middleware - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

2

lib/conditional.js

@@ -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);

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