Update for new combinator API

master
Sven Slootweg 4 years ago
parent 3517bf5266
commit 940e4265c9

@ -6,9 +6,7 @@ const annotateErrors = require("@validatem/annotate-errors");
const isArray = require("@validatem/is-array"); const isArray = require("@validatem/is-array");
module.exports = function (rules) { module.exports = function (rules) {
return [ let validator = combinator((value, applyValidators) => {
isArray,
combinator((value, applyValidators) => {
let newArray = []; let newArray = [];
let allErrors = []; let allErrors = [];
@ -28,6 +26,12 @@ module.exports = function (rules) {
errors: allErrors, errors: allErrors,
newValue: newArray newValue: newArray
}); });
}) });
validator.callIfNull = false;
return [
isArray,
validator
]; ];
}; };

Loading…
Cancel
Save