Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 | 34x 105x 105x 105x 47x 47x 105x | export default definition => (message, ...options) => (value, fields) => {
let error = typeof message === 'function' ? message(value, ...options) : message;
let isValid = false;
if (options.length ? definition(value, ...options, fields) : definition(value, fields)) {
isValid = true;
error = '';
}
return { isValid, error };
}
|