From 7901a3e75ff0026f47b641bc8779628a1fe03f6e Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 14 Jun 2020 02:50:12 +0200 Subject: [PATCH] Update for new combinator API --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 170c0e0..30326b7 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ module.exports = function (rules) { let keyRules = defaultValue(rules.key, []); let valueRules = defaultValue(rules.value, []); - return combinator((object, applyValidators) => { + let validator = combinator((object, applyValidators) => { let newObject = {}; let allErrors = []; @@ -50,5 +50,9 @@ module.exports = function (rules) { }); } }); + + validator.callIfNull = false; + + return validator; } };