Browse Source

Revert "Add callIfNull support"

This reverts commit 5dd62e2836.
master
Sven Slootweg 2 years ago
parent
commit
71304bc3f4
  1. 6
      index.js

6
index.js

@ -3,13 +3,9 @@
const combinator = require("@validatem/combinator");
module.exports = function withContext(rules, context) {
let validator = combinator((item, applyValidators, parentContext) => {
return combinator((item, applyValidators, parentContext) => {
let mergedContext = Object.assign({}, parentContext, context);
return applyValidators(item, rules, mergedContext);
});
validator.callIfNull = true;
return validator;
};

Loading…
Cancel
Save