From 38254bd28f9c72d3488c580178aa53ed3ea78cf3 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 14 Jun 2020 02:54:39 +0200 Subject: [PATCH] Revert "Add callIfNull support" This reverts commit 2170e3a2abdbfa5523194f4c96cb95e1df3bc12b. --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index 02fd677..dcb4964 100644 --- a/index.js +++ b/index.js @@ -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; } };