Created
March 19, 2023 12:44
-
-
Save imCorfitz/d461a569687fbef8c29b6b51e3162998 to your computer and use it in GitHub Desktop.
Validate submitted email address using Fakefilter
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 { isFakeEmailOnline, isFakeEmail as isFakeEmailLocal } from 'fakefilter'; | |
export default async function isFakeEmail(email: string) { | |
const onlineResponse = await isFakeEmailOnline(email); | |
if (onlineResponse === null) { | |
return !!isFakeEmailLocal(email); | |
} | |
return !!onlineResponse.isFakeDomain; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment