Compare commits

...

2 Commits

Author SHA1 Message Date
Sven Slootweg 1c13747091 0.1.2 4 years ago
Sven Slootweg 38254bd28f Revert "Add callIfNull support"
This reverts commit 2170e3a2ab.
4 years ago

@ -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;
}
};

@ -6,7 +6,7 @@
"validator",
"combinator"
],
"version": "0.1.1",
"version": "0.1.2",
"main": "index.js",
"repository": "http://git.cryto.net/validatem/either.git",
"author": "Sven Slootweg <admin@cryto.net>",

Loading…
Cancel
Save