This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This function checks if the email is valid and return the email if it is valid or return false if it is not valid | |
If covers all the modern email formats and top level domains. | |
*/ | |
const checkEmail = (email, cleanEmail = false) => { | |
const cleanUp = () => { | |
// Removing all spaces from the email | |
email = email.replace(/\s/g, ''); |