README
express-logic-middleware
a small library of middlewares to help decide which set of middleware you should run
Each middleware takes in 3 arguments
- The name (or path) of the request variable you'd like to test.
- An array of middleware to run if the evaluation is truthy.
- An array of middleware to run if the evaluation is falsey.
ifReqVarIsUndefined
- checks if request variable is equal to undefined
.
ifReqVarIsNull
- checks if request variable is equal to null
or undefined
.
ifReqVarIsTrue
- checks if request variable is equal to true
.
ifReqVarIsFalse
- checks if request variable is equal to false
.
ifTruthyInReq
- checks if request variable is truthy.
ifReqVarIs
- Use this if you want to test if a request variable is equal to a specific field.