@zootools/email-spell-checker
Advanced tools
Comparing version 1.8.3 to 1.10.0
@@ -39,3 +39,2 @@ "use strict"; | ||
'rocketmail.com', | ||
'google.com', | ||
'optonline.net', | ||
@@ -137,3 +136,3 @@ 'sbcglobal.net', | ||
secondLevelThreshold: 2, | ||
secondLevelDomains: ['yahoo', 'hotmail', 'mail', 'live', 'outlook', 'gmx'], | ||
secondLevelDomains: ['yahoo', 'hotmail', 'mail', 'live', 'outlook'], | ||
topLevelThreshold: 2, | ||
@@ -140,0 +139,0 @@ topLevelDomains: POPULAR_TLDS, |
@@ -11,5 +11,5 @@ "use strict"; | ||
distanceFunction: userOptions.distanceFunction || config_1.DEFAULT_CONFIG.distanceFunction, | ||
domainThreshold: config_1.DEFAULT_CONFIG.domainThreshold, | ||
secondLevelThreshold: config_1.DEFAULT_CONFIG.secondLevelThreshold, | ||
topLevelThreshold: config_1.DEFAULT_CONFIG.topLevelThreshold, | ||
domainThreshold: userOptions.domainThreshold || config_1.DEFAULT_CONFIG.domainThreshold, | ||
secondLevelThreshold: userOptions.secondLevelThreshold || config_1.DEFAULT_CONFIG.secondLevelThreshold, | ||
topLevelThreshold: userOptions.topLevelThreshold || config_1.DEFAULT_CONFIG.topLevelThreshold, | ||
suggested: userOptions.suggested || undefined, | ||
@@ -16,0 +16,0 @@ empty: userOptions.suggested || undefined, |
@@ -10,4 +10,7 @@ declare type DistanceFunction = (a: string, b: string, threshold?: number) => number; | ||
domains?: string[]; | ||
domainThreshold?: number; | ||
topLevelDomains?: string[]; | ||
topLevelThreshold?: number; | ||
secondLevelDomains?: string[]; | ||
secondLevelThreshold?: number; | ||
distanceFunction?: DistanceFunction; | ||
@@ -14,0 +17,0 @@ suggested?: (suggestion?: MailSuggestion) => void; |
{ | ||
"private": false, | ||
"name": "@zootools/email-spell-checker", | ||
"version": "1.8.3", | ||
"version": "1.10.0", | ||
"description": "mailSpellChecker.js (mail spell checker) is a lightweight module that suggests a right domain when your users misspell it in an email address", | ||
@@ -16,2 +16,3 @@ "main": "./dist/index.js", | ||
"prepare": "husky install", | ||
"release": "npm run build && npm publish", | ||
"semantic-release": "semantic-release", | ||
@@ -18,0 +19,0 @@ "test:watch": "jest --watch", |
<p align="center"> | ||
<a href="https://zootools.co/?ref=github-spell"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://open-source.zootools.co/email-spell-checker/logo_email-spell-checker.png?raw=true"> | ||
<img src="https://open-source.zootools.co/email-spell-checker/logo_email-spell-checker.png?raw=true" height="140"> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://open-source.zootools.co/email-spell-checker/logo_email-spell-checker.png?raw=true" /> | ||
<img src="https://open-source.zootools.co/email-spell-checker/logo_email-spell-checker.png?raw=true" width="456px" /> | ||
</picture> | ||
@@ -68,5 +68,5 @@ </a> | ||
- [🟨 JavaScript: Getting started in 5 minutes](#getting-started-in-5-minutes) | ||
- [🟦 React: Validating email spell in React](./docs/React.md) | ||
- [🟩 Node: Validating email spell in Node](./docs/Node.md) | ||
- [🟨 JavaScript: Getting started in 5 minutes](./demos/javascript/) | ||
- 🟦 React: Validating email spell in React (coming soon) | ||
- [🟩 Node with Express.js: Validating email spell in Node](./demos/node-express/) | ||
@@ -97,8 +97,4 @@ If you want to write a tutorial [send a PR](https://github.com/zootools/email-spell-checker/pulls) or [create an issue](https://github.com/zootools/email-spell-checker/issues) if you want to ask for one. | ||
Using the library is really easy: | ||
Using the library is easy. Import it, call `run` function with the email you want to validate, and get a suggestion. | ||
- Import it. | ||
- Call `run` function with the email you want to validate. | ||
- Get the suggested email, and prompt your user to accept the suggestion. | ||
```js | ||
@@ -113,3 +109,3 @@ import emailSpellChecker from '@zootools/email-spell-checker'; | ||
// DEV: Handle the suggestion. | ||
// E.g: tell the user their email is wrong and offer to apply your suggestion | ||
// E.g: tell the user their email is wrong and offer to apply your suggestion. | ||
@@ -116,0 +112,0 @@ console.log(suggestedEmail); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34169
637
200