Huge News!Announcing our $40M Series B led by Abstract Ventures.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 3.0.1 to 3.1.0

lib/typings/index.d.ts

3

domains/all.d.ts

@@ -1,2 +0,3 @@

export declare const all: string[];
import { DomainList } from "../typings";
export declare const all: DomainList;
export default all;

@@ -1,2 +0,3 @@

export declare const aol: string[];
import { DomainList } from "../typings";
export declare const aol: DomainList;
export default aol;

@@ -1,2 +0,3 @@

export declare const hotmail: string[];
import { DomainList } from "../typings";
export declare const hotmail: DomainList;
export default hotmail;

@@ -1,2 +0,3 @@

export declare const live: string[];
import { DomainList } from "../typings";
export declare const live: DomainList;
export default live;

@@ -1,1 +0,2 @@

export declare const microsoft: string[];
import { DomainList } from "../typings";
export declare const microsoft: DomainList;

@@ -1,2 +0,3 @@

export declare const more: string[];
import { DomainList } from "../typings";
export declare const more: DomainList;
export default more;

@@ -1,2 +0,3 @@

export declare const outlook: string[];
import { DomainList } from "../typings";
export declare const outlook: DomainList;
export default outlook;

@@ -1,2 +0,3 @@

export declare const top100: string[];
import { DomainList } from "../typings";
export declare const top100: DomainList;
export default top100;

@@ -1,2 +0,3 @@

export declare const yahoo: string[];
import { DomainList } from "../typings";
export declare const yahoo: DomainList;
export default yahoo;

@@ -1,2 +0,3 @@

export declare const all: string[];
import { DomainList } from "../typings";
export declare const all: DomainList;
export default all;

@@ -1,2 +0,3 @@

export declare const aol: string[];
import { DomainList } from "../typings";
export declare const aol: DomainList;
export default aol;

@@ -1,2 +0,3 @@

export declare const hotmail: string[];
import { DomainList } from "../typings";
export declare const hotmail: DomainList;
export default hotmail;

@@ -1,2 +0,3 @@

export declare const live: string[];
import { DomainList } from "../typings";
export declare const live: DomainList;
export default live;

@@ -1,1 +0,2 @@

export declare const microsoft: string[];
import { DomainList } from "../typings";
export declare const microsoft: DomainList;

@@ -1,2 +0,3 @@

export declare const more: string[];
import { DomainList } from "../typings";
export declare const more: DomainList;
export default more;

@@ -1,2 +0,3 @@

export declare const outlook: string[];
import { DomainList } from "../typings";
export declare const outlook: DomainList;
export default outlook;

@@ -1,2 +0,3 @@

export declare const top100: string[];
import { DomainList } from "../typings";
export declare const top100: DomainList;
export default top100;

@@ -1,2 +0,3 @@

export declare const yahoo: string[];
import { DomainList } from "../typings";
export declare const yahoo: DomainList;
export default yahoo;

@@ -1,25 +0,3 @@

export interface Result {
/** suggested domain */
suggest: string;
/** corrected email */
corrected: string;
/** number correction needed */
misspelledCount: number;
/** original email */
original: string;
}
export interface EmailMisspelled {
(email: string): Result[];
}
export declare type EmailMisspelledConstructor = {
(config: {
/** Maximum length difference between strings; Default: 2 */
lengthDiffMax?: number;
/** Number of misspelled error allowed; Default: 2 */
maxMisspelled?: number;
/** List of email domain to compare */
domains: string[];
}): EmailMisspelled;
};
import { EmailMisspelledConstructor } from "./typings";
export declare const emailMisspelled: EmailMisspelledConstructor;
export default emailMisspelled;

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"emailMisspelled",(function(){return a}));var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 1===e.replace(/[^@]/g,"").length},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.includes("@")?e.replace(/.*@/,""):""},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var r=e.length-n.length;return r<=t&&r>=-t}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suggest:"",corrected:"",original:"",misspelledCount:0},r=Array(e.length+1).fill(null).map((function(){return Array(n.suggest.length+1).fill(null)})),o=0;o<=n.suggest.length;o+=1)r[0][o]=o;for(var i=0;i<=e.length;i+=1)r[i][0]=i;for(var u=1;u<=e.length;u+=1)for(var l=1;l<=n.suggest.length;l+=1){var f=n.suggest[l-1]===e[u-1]?0:1;r[u][l]=Math.min(r[u][l-1]+1,r[u-1][l]+1,r[u-1][l-1]+f)}return n.misspelledCount=r[e.length][n.suggest.length],n.misspelledCount<=t}},l=function(e){return{suggest:e,corrected:"",original:"",misspelledCount:0}},f=function(e){return function(t){return e&&(null==t?void 0:t.suggest)?(t.corrected=e.replace(/@.*$/,"@".concat(t.suggest)),t.original=e,t):t}},s=function(e,t){return e.misspelledCount-t.misspelledCount},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lengthDiffMax:2,maxMisspelled:2,domains:[]},t=e.lengthDiffMax,n=void 0===t?2:t,a=e.maxMisspelled,c=void 0===a?2:a,d=e.domains;if(!d||!Array.isArray(d)||!d.length)throw new Error("Please provide a domain list");return function(e){if(!r(e))return[];var t=o(e);if(d.includes(t))return[];var a=i(t,n),g=u(t,c),p=f(e),v=d.filter(a).map(l).filter(g).map(p).sort(s);return v.length?v:[]}};t.default=a}])}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"emailMisspelled",(function(){return s}));var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 1===e.replace(/[^@]/g,"").length},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.includes("@")?e.replace(/.*@/,""):""},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var r=e.length-n.length;return r<=t&&r>=-t}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){for(var r=Array(e.length+1).fill(null).map((function(){return Array(n.suggest.length+1).fill(null)})),o=0;o<=n.suggest.length;o+=1)r[0][o]=o;for(var i=0;i<=e.length;i+=1)r[i][0]=i;for(var u=1;u<=e.length;u+=1)for(var l=1;l<=n.suggest.length;l+=1){var f=n.suggest[l-1]===e[u-1]?0:1;r[u][l]=Math.min(r[u][l-1]+1,r[u-1][l]+1,r[u-1][l-1]+f)}return n.misspelledCount=r[e.length][n.suggest.length],n.misspelledCount<=t}},l=function(e){return{suggest:e,corrected:"",original:"",misspelledCount:0}},f=function(e){return function(t){return e&&t.suggest?(t.corrected=e.replace(/@.*$/,"@".concat(t.suggest)),t.original=e,t):t}},a=function(e,t){return e.misspelledCount-t.misspelledCount},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lengthDiffMax:2,maxMisspelled:2,domains:[]},t=e.lengthDiffMax,n=void 0===t?2:t,s=e.maxMisspelled,c=void 0===s?2:s,d=e.domains;if(!d||!Array.isArray(d)||!d.length)throw new Error("Please provide a domain list");return function(e){if(!r(e))return[];var t=o(e);if(d.includes(t))return[];var s=i(t,n),g=u(t,c),p=f(e),v=d.filter(s).map(l).filter(g).map(p).sort(a);return v.length?v:[]}};t.default=s}])}));

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(global,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"emailMisspelled",(function(){return s}));var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 1===e.replace(/[^@]/g,"").length},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.includes("@")?e.replace(/.*@/,""):""},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var r=e.length-n.length;return r<=t&&r>=-t}},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suggest:"",corrected:"",original:"",misspelledCount:0},r=Array(e.length+1).fill(null).map((function(){return Array(n.suggest.length+1).fill(null)})),o=0;o<=n.suggest.length;o+=1)r[0][o]=o;for(var i=0;i<=e.length;i+=1)r[i][0]=i;for(var l=1;l<=e.length;l+=1)for(var u=1;u<=n.suggest.length;u+=1){var f=n.suggest[u-1]===e[l-1]?0:1;r[l][u]=Math.min(r[l][u-1]+1,r[l-1][u]+1,r[l-1][u-1]+f)}return n.misspelledCount=r[e.length][n.suggest.length],n.misspelledCount<=t}},u=function(e){return{suggest:e,corrected:"",original:"",misspelledCount:0}},f=function(e){return function(t){return e&&(null==t?void 0:t.suggest)?(t.corrected=e.replace(/@.*$/,"@".concat(t.suggest)),t.original=e,t):t}},a=function(e,t){return e.misspelledCount-t.misspelledCount},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lengthDiffMax:2,maxMisspelled:2,domains:[]},t=e.lengthDiffMax,n=void 0===t?2:t,s=e.maxMisspelled,c=void 0===s?2:s,d=e.domains;if(!d||!Array.isArray(d)||!d.length)throw new Error("Please provide a domain list");return function(e){if(!r(e))return[];var t=o(e);if(d.includes(t))return[];var s=i(t,n),g=l(t,c),p=f(e),v=d.filter(s).map(u).filter(g).map(p).sort(a);return v.length?v:[]}};t.default=s}])}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(global,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"emailMisspelled",(function(){return s}));var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 1===e.replace(/[^@]/g,"").length},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.includes("@")?e.replace(/.*@/,""):""},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var r=e.length-n.length;return r<=t&&r>=-t}},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){for(var r=Array(e.length+1).fill(null).map((function(){return Array(n.suggest.length+1).fill(null)})),o=0;o<=n.suggest.length;o+=1)r[0][o]=o;for(var u=0;u<=e.length;u+=1)r[u][0]=u;for(var i=1;i<=e.length;i+=1)for(var l=1;l<=n.suggest.length;l+=1){var f=n.suggest[l-1]===e[i-1]?0:1;r[i][l]=Math.min(r[i][l-1]+1,r[i-1][l]+1,r[i-1][l-1]+f)}return n.misspelledCount=r[e.length][n.suggest.length],n.misspelledCount<=t}},l=function(e){return{suggest:e,corrected:"",original:"",misspelledCount:0}},f=function(e){return function(t){return e&&t.suggest?(t.corrected=e.replace(/@.*$/,"@".concat(t.suggest)),t.original=e,t):t}},a=function(e,t){return e.misspelledCount-t.misspelledCount},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lengthDiffMax:2,maxMisspelled:2,domains:[]},t=e.lengthDiffMax,n=void 0===t?2:t,s=e.maxMisspelled,c=void 0===s?2:s,d=e.domains;if(!d||!Array.isArray(d)||!d.length)throw new Error("Please provide a domain list");return function(e){if(!r(e))return[];var t=o(e);if(d.includes(t))return[];var s=u(t,n),g=i(t,c),p=f(e),v=d.filter(s).map(l).filter(g).map(p).sort(a);return v.length?v:[]}};t.default=s}])}));
export * from "./domains";
import { emailMisspelled } from "./emailMisspelled";
export type { Result, EmailMisspelled, EmailMisspelledConstructor } from "./emailMisspelled";
export type { DomainList, Result, EmailMisspelled, EmailMisspelledConstructor } from "./typings";
export default emailMisspelled;

@@ -12,4 +12,4 @@ {

"test:coverage:report": "codecov --token=$CODECOV_TOKEN",
"clear": "rimraf ./lib && rimraf ./domains",
"build:all": "yarn clear && yarn build:webpack && yarn build:transpile && yarn build:domains && yarn build:types && yarn build:domains:copy",
"clear": "rimraf ./lib && rimraf ./domains && rimraf ./typings",
"build:all": "yarn clear && yarn build:webpack && yarn build:transpile && yarn build:domains && yarn build:types && yarn build:domains:copy && yarn build:types:copy",
"build:transpile": "babel src/index.ts --out-dir lib --extensions .ts",

@@ -20,2 +20,3 @@ "build:domains": "babel src/domains --out-dir lib/domains --extensions .ts",

"build:types": "tsc",
"build:types:copy": "cpy lib/typings typings",
"prepublishOnly": "yarn test:ci && yarn build:all"

@@ -30,3 +31,5 @@ },

"/lib/domains",
"/domains"
"/lib/typings",
"/domains",
"/typings"
],

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

"babel-loader": "^8.0.6",
"codecov": "^3.7.1",
"codecov": "^3.7.2",
"cpy-cli": "^3.1.1",

@@ -86,3 +89,3 @@ "css-loader": "^3.2.0",

},
"version": "3.0.1"
"version": "3.1.0"
}

@@ -6,5 +6,5 @@ <h2 align="center">email-misspelled</h2>

[![npm](https://img.shields.io/npm/v/email-misspelled.svg?style=flat-square)](https://www.npmjs.com/package/email-misspelled)
[![CircleCI Status](https://circleci.com/gh/sl-julienamblard/email-misspelled.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/sl-julienamblard/email-misspelled)
[![codecov](https://codecov.io/gh/sl-julienamblard/email-misspelled/branch/master/graph/badge.svg)](https://codecov.io/gh/sl-julienamblard/email-misspelled)
[![npm](https://img.shields.io/bundlephobia/min/email-misspelled)](https://www.npmjs.com/package/email-misspelled)
[![CircleCI Status](https://img.shields.io/circleci/build/github/sl-julienamblard/email-misspelled/master?style=flat-square)](https://circleci.com/gh/sl-julienamblard/email-misspelled)
[![codecov](https://img.shields.io/codecov/c/github/sl-julienamblard/email-misspelled?logo=codecov&style=flat-square)](https://codecov.io/gh/sl-julienamblard/email-misspelled)
[![npm](https://img.shields.io/bundlephobia/minzip/email-misspelled?style=flat-square)](https://www.npmjs.com/package/email-misspelled)
[![npm](https://img.shields.io/npm/dt/email-misspelled.svg?style=flat-square)](https://www.npmjs.com/package/email-misspelled)

@@ -32,2 +32,3 @@ [![npm](https://img.shields.io/npm/l/email-misspelled.svg?style=flat-square)](https://github.com/sl-julienamblard/email-misspelled/blob/master/LICENSE)

- [**lengthDiffMax**](#lengthDiffMax)
4. [Typescript support](#types)

@@ -62,3 +63,8 @@ <a id="install"></a>

/**
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com", original: "user@otmail.com"}]
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"user@hotmail.com",
* original: "user@otmail.com"
* }]
**/

@@ -70,3 +76,3 @@ ```

**Returned object model**
[Result](#TResult)
```ts

@@ -94,3 +100,3 @@ Result = {

| :--- | :------- | :---------- |
| `string[]` | true | list of domains to compare |
| `string[]` [DomainList](#TDomainList) | true | list of domains to compare |

@@ -107,3 +113,8 @@ <br />

* return :
* [{ suggest: "random.org", misspelledCount: 1, corrected:"user@random.org", original: "user@randmo.org"}]
* [{
* suggest: "random.org",
* misspelledCount: 1,
* corrected:"user@random.org",
* original: "user@randmo.org"
* }]
**/

@@ -167,3 +178,8 @@ ```

* return :
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com", original: "user@hotmial.com"}]
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"user@hotmail.com",
* original: "user@hotmial.com"
* }]
**/

@@ -177,3 +193,8 @@ emailChecker1("user@hotmia.com") // []

* return :
* [{ suggest: "hotmail.com", misspelledCount: 2, corrected:"user@hotmail.com", original: "user@hotmial.com"}]
* [{
* suggest: "hotmail.com",
* misspelledCount: 2,
* corrected:"user@hotmail.com",
* original: "user@hotmial.com"
* }]
**/

@@ -183,3 +204,8 @@ emailChecker2("user@hotmia.com")

* return :
* [{ suggest: "hotmail.com", misspelledCount: 3, corrected:"user@hotmail.com", original: "user@hotmia.com"}]
* [{
* suggest: "hotmail.com",
* misspelledCount: 3,
* corrected:"user@hotmail.com",
* original: "user@hotmia.com"
* }]
**/

@@ -206,3 +232,8 @@ emailChecker2("user@otmia.com") //4 misspelled, return []

* return :
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com", original: "user@otmail.com"}]
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"user@hotmail.com",
* original: "user@otmail.com"
* }]
**/

@@ -216,3 +247,8 @@ emailChecker1("user@tmail.com") // []

* return :
* [{ suggest: "hotmail.com", misspelledCount: 1, corrected:"user@hotmail.com", original: "user@otmail.com"}]
* [{
* suggest: "hotmail.com",
* misspelledCount: 1,
* corrected:"user@hotmail.com",
* original: "user@otmail.com"
* }]
**/

@@ -222,6 +258,14 @@ emailChecker2("user@tmail.com")

* return :
* [
* { suggest: "gmail.com", misspelledCount: 1, corrected:"user@gmail.com", original: "user@tmail.com" }
* { suggest: "hotmail.com", misspelledCount: 2, corrected:"user@hotmail.com", original: "user@tmail.com"},
* ]
* [{
* suggest: "gmail.com",
* misspelledCount: 1,
* corrected:"user@gmail.com",
* original: "user@tmail.com"
* },
* {
* suggest: "hotmail.com",
* misspelledCount: 2,
* corrected:"user@hotmail.com",
* original: "user@tmail.com"
* }]
**/

@@ -233,2 +277,57 @@ ```

<br />
<a id="types"></a>
<h2 align="center">Typescript support</h2>
You can find Types and Interfaces under the `/typings` folder
<a id="TDomainList"></a>
**`DomainList`**
```ts
import { DomainList } from "email-misspelled/typings"
string[]
```
<a id="TEmailMisspelledConstructor"></a>
**`EmailMisspelledConstructor`**
```ts
import { EmailMisspelledConstructor } from "email-misspelled/typings"
(config: {
lengthDiffMax?: number;
maxMisspelled?: number;
domains: DomainList;
}): EmailMisspelled;
```
<a id="TEmailMisspelled"></a>
**`EmailMisspelled`**
```ts
import { EmailMisspelled } from "email-misspelled/typings"
(email: string): Result[]
```
<a id="TResult"></a>
**`Result`**
```ts
import { Result } from "email-misspelled/typings"
{
suggest: string;
corrected: string;
misspelledCount: number;
original: string;
}
```
---
### Top 100 domains list <a id="top100"></a>

@@ -343,6 +442,4 @@

- [ ] update demo
- [x] external domain list
- [x] split domain list into smallest part (only hotmail, only gmail etc)
- [ ] allow returning only first result
- [x] Doc

@@ -352,1 +449,4 @@ - [x] TU

- [x] Extend default domain list
- [x] explicit folder for types exports
- [ ] update demo
- [ ] allow returning only first result
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