Validation Results
import validate from 'strickland';
function letterA(value) {
// We can return a validation result as a boolean
return (value === 'A');
// Or as an object
// return {
// isValid: (value === 'A')
// };
}
const result = validate(letterA, 'B');
// Either way, the result will match:
//
// result = {
// isValid: false,
// value: 'B'
// }Last updated