const composeValidators = ( validators ) => ( value , allValues ) => validators . filter ( Boolean ) . reduce ( ( error , validator ) => error || validator ( value , allValues ) , undefined ) ; const required = ( value ) => value === undefined || value === false || value === '' || value === null || ( Array . isArray ( value ) && value . length === 0 ) ? 'Please complete this field.' : undefined ; export default { composeValidators , required } ;