New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

email-misspelled

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-misspelled - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

19

package.json
{
"name": "email-misspelled",
"description": "Check misspell email domain and return a matching domain suggestion",
"description": "Check misspell email's domain and return a list of matching domain suggestions",
"main": "lib/index.js",
"scripts": {
"dev": "webpack-dev-server --mode development --config webpack.dev.js",
"demo": "yarn build:lib && webpack-dev-server --mode production --config webpack.prod.js",
"test:ci": "yarn jest --config=./tests/jest.config.js",

@@ -10,4 +12,2 @@ "test:watch": "yarn jest --config=./tests/jest.config.js --verbose --watchAll",

"test:coverage:report": "codecov --token=$CODECOV_TOKEN",
"dev": "webpack-dev-server --mode development --config webpack.dev.js",
"demo": "yarn build:lib && webpack-dev-server --mode production --config webpack.prod.js",
"build:all": "rimraf ./lib && yarn build:lib && yarn build:types",

@@ -19,3 +19,5 @@ "build:lib": "webpack --config webpack.config.js",

"files": [
"/lib"
"/lib/index.js",
"/lib/index.d.ts",
"/lib/Result.interface.d.ts"
],

@@ -40,7 +42,8 @@ "repository": {

"misspelled",
"misspell",
"misstype",
"mailcheck",
"validator",
"checker",
"autocorrect",
"correct"
"lightweight",
"corrector"
],

@@ -71,3 +74,3 @@ "devDependencies": {

},
"version": "2.0.1"
"version": "2.0.2"
}
# email-misspelled
**Lightweight 4ko lib**
---
[![CircleCI Status](https://circleci.com/gh/Julien-Amblard/email-misspelled.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/Julien-Amblard/email-misspelled)

@@ -9,4 +11,6 @@ [![codecov](https://codecov.io/gh/Julien-Amblard/email-misspelled/branch/master/graph/badge.svg)](https://codecov.io/gh/Julien-Amblard/email-misspelled)

---
> Check misspell email's domain and return a list of matching domain suggestions
String comparison is based on [this](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/string/levenshtein-distance)

@@ -19,5 +23,5 @@

- [Options](#options)
- [lengthDiffMax](#lengthDiffMax)
- [maxMisspelled](#maxMisspelled)
- [domainList](#domainList)
- [lengthDiffMax](#lengthDiffMax)

@@ -51,38 +55,4 @@ ## Install <a id="install"></a>

### lengthDiffMax <a id="lengthDiffMax"></a>
| Type | Default | Description |
|:----|:----|:----|
| `number` | `2` | max length difference between two string |
```js
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ lengthDiffMax: 1 })
emailChecker1("user@otmail.com")
/**
* return :
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com"}]
**/
emailChecker1("user@tmail.com") // undefined
const emailChecker2 = emailMisspelled({ lengthDiffMax: 2 })
emailChecker2("user@otmail.com")
/**
* return :
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com"}]
**/
emailChecker2("user@tmail.com")
/**
* return :
* [
* { suggest: "gmail.com", misspelledCount: 1, corrected:"user@gmail.com"}
* { suggest: "hotmail.com", misspelledCount: 2, corrected:"user@hotmail.com"},
* ]
**/
```
---
### maxMisspelled <a id="maxMisspelled"></a>

@@ -142,2 +112,39 @@

### lengthDiffMax <a id="lengthDiffMax"></a>
| Type | Default | Description |
|:----|:----|:----|
| `number` | `2` | max length difference between two string |
```js
import emailMisspelled from "email-misspelled"
const emailChecker1 = emailMisspelled({ lengthDiffMax: 1 })
emailChecker1("user@otmail.com")
/**
* return :
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com"}]
**/
emailChecker1("user@tmail.com") // undefined
const emailChecker2 = emailMisspelled({ lengthDiffMax: 2 })
emailChecker2("user@otmail.com")
/**
* return :
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com"}]
**/
emailChecker2("user@tmail.com")
/**
* return :
* [
* { suggest: "gmail.com", misspelledCount: 1, corrected:"user@gmail.com"}
* { suggest: "hotmail.com", misspelledCount: 2, corrected:"user@hotmail.com"},
* ]
**/
```
---
### Default domain list <a id="domainListDefault"></a>

@@ -144,0 +151,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc