Revert "Add callIfNull support"

This reverts commit 2170e3a2ab.
master
Sven Slootweg 4 years ago
parent a8b6da1b59
commit 38254bd28f

@ -14,7 +14,7 @@ module.exports = function (alternatives) {
} else if (arguments.length > 1) {
throw new Error(`Only one argument is accepted; maybe you forgot to wrap the different alternatives into an array?`);
} else {
let validator = combinator((value, applyValidators) => {
return combinator((value, applyValidators) => {
let allErrors = [];
for (let alternative of alternatives) {
@ -35,9 +35,5 @@ module.exports = function (alternatives) {
throw new ValidationError(`Must satisfy at least one of: ${errorList}`, { errors: allErrors });
});
validator.callIfNull = true;
return validator;
}
};

Loading…
Cancel
Save