diff --git a/src/apply-validators.js b/src/apply-validators.js index f60192c..c4460e0 100644 --- a/src/apply-validators.js +++ b/src/apply-validators.js @@ -12,7 +12,12 @@ module.exports = function applyValidators(value, rules, context = {}) { let normalizedRules = normalizeRules(rules, { normalizeObjects: true }); let validator = composeRules.compose(normalizedRules); - let { errors, newValue } = validator(value, context); + // FIXME: Document this option! + let finalContext = (process.env.VALIDATEM_NO_HEURISTICS === "1") + ? { ...context, __validatemNoHeuristics: true } + : context; + + let { errors, newValue } = validator(value, finalContext); // NOTE: We mutate the error here, because Error objects are not safely cloneable for (let error of errors) {