email-misspelled
Check misspell email domain and return a matching domain suggestion
String comparison is based on this
Install
npm i email-misspelled --save
or
yarn add email-misspelled
Importing
import emailMisspelled from "email-misspelled"
const emailChecker = emailMisspelled()
emailChecker("user@otmail.com")
Options
lengthDiffMax
Type | Default | Description |
---|
number | 2 | max length difference between two string |
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ lengthDiffMax: 1 })
emailChecker1("user@otmail.com")
emailChecker1("user@tmail.com")
const emailChecker1 = emailMisspelled({ lengthDiffMax: 2 })
emailChecker1("user@otmail.com")
emailChecker1("user@tmail.com")
maxMisspelled
Type | Default | Description |
---|
number | 2 | max possible misspelled |
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ maxMisspelled: 1 })
emailChecker1("user@hotmial.com")
emailChecker1("user@hotmia.com")
const emailChecker1 = emailMisspelled({ maxMisspelled: 2 })
emailChecker1("user@hotmial.com")
emailChecker1("user@hotmia.com")
domainList
Type | Default | Description |
---|
string[] | Domain list | max possible misspelled |
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ domainList: ["random.org"] })
emailChecker1("user@hotmial.com")
emailChecker1("user@randmo.org")
Default domain list
outlook.com
gmail.com
hotmail.com
hotmail.fr
live.fr
live.com
laposte.fr
wanadoo.fr
TODO