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