Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function createValidator(name) {
const validate = validator(name, { greedy: true });
return input => {
if (validate(input))
return;
const reasons = validate.errors.map(e => log.debug('invalid_field', e));
throw log.info('invalid_body', reasons);
};
}