-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(email): isolate is free email fn
- Loading branch information
1 parent
3cb488a
commit 7d239dc
Showing
9 changed files
with
700 additions
and
617 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "@numerique-gouv/moncomptepro.free-email", | ||
"version": "0.0.0", | ||
"private": true, | ||
"type": "module", | ||
"exports": { | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "tsc --build", | ||
"dev": "npm run build -- --watch --preserveWatchOutput", | ||
"check": "npm run build -- --noEmit" | ||
}, | ||
"dependencies": { | ||
"is-disposable-email-domain": "^1.0.7" | ||
}, | ||
"devDependencies": { | ||
"@tsconfig/node22": "^22.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
|
||
import { isFree } from "is-disposable-email-domain"; | ||
import mostUsedFreeEmailDomains from "./most-used-free-email-domains"; | ||
|
||
// | ||
|
||
export function isAFreeDomain(domain: string) { | ||
// heavily inspired from https://stackoverflow.com/questions/71232973/check-email-domain-type-personal-email-or-company-email#answer-72640757 | ||
return isFree(domain) || mostUsedFreeEmailDomains.includes(domain); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"outDir": "./dist", | ||
"rootDir": "src", | ||
"types": ["./types"], | ||
"module": "Preserve", | ||
"moduleResolution": "Bundler", | ||
"verbatimModuleSyntax": true | ||
}, | ||
"extends": "@tsconfig/node22/tsconfig.json", | ||
"references": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// | ||
|
||
declare module "is-disposable-email-domain" { | ||
function isFree(email: string): boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters