Created
June 5, 2021 01:46
-
-
Save mosufy/7c46661ebacf750c1865debd7f09ae72 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import emailCheck from 'email-check-lib'; | |
export const validateEmail = email => { | |
const emailCheck = new EmailCheck(); | |
const emailValidated = emailCheck.validate(params.newEmail); | |
if (!emailValidated) { | |
throw new Error('Invalid email'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment