You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
437 B
JavaScript
18 lines
437 B
JavaScript
"use strict";
|
|
|
|
const combinator = require("@validatem/combinator");
|
|
const validationResult = require("@validatem/validation-result");
|
|
|
|
// TODO: Document that this passes on context
|
|
|
|
module.exports = function ignoreResult(rules) {
|
|
return combinator((value, applyValidators, context) => {
|
|
let result = applyValidators(value, rules, context);
|
|
|
|
return validationResult({
|
|
errors: result.errors,
|
|
newValue: undefined
|
|
});
|
|
});
|
|
};
|