validation-chain-builders.js 458 B

123456789101112
  1. const check = require('./check');
  2. const buildCheckFunction = locations => (fields, message) => check(fields, locations, message);
  3. module.exports = {
  4. buildCheckFunction,
  5. check: buildCheckFunction(['body', 'cookies', 'headers', 'params', 'query']),
  6. body: buildCheckFunction(['body']),
  7. cookie: buildCheckFunction(['cookies']),
  8. header: buildCheckFunction(['headers']),
  9. param: buildCheckFunction(['params']),
  10. query: buildCheckFunction(['query'])
  11. };