From b1a5951b47b067146782faf578938493150de056 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 14 Jun 2020 02:59:36 +0200 Subject: [PATCH] Revert "Add callIfNull support" This reverts commit cb16313b03a20449eae56895ed76e1e720a11279. --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index 3e289b2..0a99d98 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ function concat(arrays) { module.exports = function wrapError(message, rules, options = {}) { let preserveOriginalErrors = defaultValue(options.preserveOriginalErrors, false); - let validator = combinator((value, applyValidators, context) => { + return combinator((value, applyValidators, context) => { let result = applyValidators(value, rules, context); if (result.errors.length > 0) { @@ -76,8 +76,4 @@ module.exports = function wrapError(message, rules, options = {}) { return result; } }); - - validator.callIfNull = true; - - return validator; };