1 2 3 4 5 6 7 8 9 10 11 12 | 1× 5× 10× 8× 4× 4× | export default function validateSometimes(validators, condition) { return validators.map(function(validator) { return function(key, newValue, oldValue, changes, content) { if (condition(changes, content)) { return validator(key, newValue, oldValue, changes, content); } return true; }; }); } |