Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

email-misspelled

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-misspelled

A autocorrect misspelled email domain


Version published
Weekly downloads
9.3K
increased by36.69%
Maintainers
1
Weekly downloads
 
Created

email-misspelled

CircleCI Status codecov npm npm npm

check possible misspelled in email value and return a matching domain string thanks to 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") // hotmail.com


Options

lengthDiffMax

TypeDefaultDescription
number2max length difference between two string
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ lengthDiffMax: 1 })

emailChecker1("user@otmail.com") // hotmail.com
emailChecker1("user@tmail.com") // undefined

const emailChecker1 = emailMisspelled({ lengthDiffMax: 2 })

emailChecker1("user@otmail.com") // hotmail.com
emailChecker1("user@tmail.com") // hotmail.com

maxMisspelled

TypeDefaultDescription
number2max possible misspelled
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ maxMisspelled: 1 })

emailChecker1("user@hotmial.com") // hotmail.com
emailChecker1("user@hotmia.com") // undefined

const emailChecker1 = emailMisspelled({ maxMisspelled: 2 })

emailChecker1("user@hotmial.com") // hotmail.com
emailChecker1("user@hotmia.com") // hotmail.com

domainList

TypeDefaultDescription
string[]Domain listmax possible misspelled
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ domainList: ["random.org"] })

emailChecker1("user@hotmial.com") // undefined
emailChecker1("user@randmo.org") // random.org

Default domain list

  • outlook.com
  • gmail.com
  • hotmail.com
  • hotmail.fr
  • live.fr
  • live.com
  • laposte.fr
  • wanadoo.fr

TODO

  • Doc
  • TU
  • TS
  • Extend default domain list

FAQs

Package last updated on 11 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts