param message param value const requiredField = message => value => ( ) => { const valid = ! ( ! value || value . length === 0 ) ; return { valid , message : ! valid ? message : '' , } ; } ; const requiredToken = value => ( ) => { if ( ! value || value . length === 0 ) { return { valid : false , message : 'Token is required' , } ; } return { valid : true , } ; } ; const requiredPassword = value => ( ) => { if ( ! value || value . length < 6 ) { return { valid : false , message : 'Enter at least 6 characters' , } ; } return { valid : true , } ; } ; const requiredConfirmedPassword = password => confirmedPassword => ( ) => { if ( ! confirmedPassword ) { return { valid : false , message : 'Please confirm your password' , } ; } if ( confirmedPassword !== password ) { return { valid : false , message : 'Password does not match' , } ; } return { valid : true , } ; } ; export { requiredToken , requiredPassword , requiredConfirmedPassword , requiredField , } ;