Skip to content

Instantly share code, notes, and snippets.

@bettdouglas
Created June 19, 2019 12:22
Show Gist options
  • Save bettdouglas/348a4187d8c010363c5e6b8eced6d256 to your computer and use it in GitHub Desktop.
Save bettdouglas/348a4187d8c010363c5e6b8eced6d256 to your computer and use it in GitHub Desktop.
_validator.ruleFor('email', ()=>text)
..notEmpty() // enforces that the email should not be empty
..withMessage('Email cannot be empty') //return message if the email is empty
..emailAddress() //checks if the email is a valid email address -- validation
..withMessage('Enter a valid email'); //return message if email is empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment