From ae94d60c5987bec64f764d0f5d22c1093c5ee236 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 14 Jun 2020 02:55:38 +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 397e6b2..b705a24 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ function containsRules(rules) { } module.exports = function hasShape(rules) { - return combinator((object, applyValidators, context) => { + let validator = combinator((object, applyValidators, context) => { let allowExtraProperties = defaultValue(context.allowExtraProperties, false); let unexpectedPropertyErrors = asExpression(() => { @@ -80,4 +80,8 @@ module.exports = function hasShape(rules) { }); } }); + + validator.callIfNull = false; + + return validator; };