Created
January 23, 2020 07:43
-
-
Save jmahc/254320346f749f064c111c3770035cb7 to your computer and use it in GitHub Desktop.
Express Validator function collector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Validate with the provided `express-validator` function options. | |
* | |
* @export {Function} A function that will utilzie `express-validator` methods to validate parameters. | |
* @param {Functions} fns The `express-validator` methods to validate parameters. | |
* @returns {Array} An array of functions with the `express-validator` middleware provided. | |
*/ | |
export function validateWith(...fns) { | |
return [...fns, validatorMiddleware] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment