email-disposable 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,30 +1,30 @@
1
- import domainsList from "./disposable.json" with { type: "json" }
2
-
3
- export { domainsList }
4
-
5
- export default function isDisposable(email) {
6
-
7
- if(typeof email !== "string") return false
8
-
9
- const parts = email.split("@")
10
- if(parts.length !== 2) return false
11
-
12
- let domain = parts[1].toLowerCase().trim()
13
-
14
- if(domainsList.includes(domain)) return true
15
-
16
- return domainsList.some(pattern => {
17
- const normalized = pattern.toLowerCase()
18
- if(normalized.includes("*")) {
19
- const regex = new RegExp(
20
- "^" +
21
- normalized
22
- .replace(/\./g, "\\.")
23
- .replace(/\*/g, ".*")
24
- + "$"
25
- )
26
- return regex.test(domain)
27
- }
28
- })
29
-
1
+ import domainsList from "./disposable.json" with { type: "json" }
2
+
3
+ export { domainsList }
4
+
5
+ export default function isDisposable(email) {
6
+
7
+ if(typeof email !== "string") return false
8
+
9
+ const parts = email.split("@")
10
+ if(parts.length !== 2) return false
11
+
12
+ let domain = parts[1].toLowerCase().trim()
13
+
14
+ if(domainsList.includes(domain)) return true
15
+
16
+ return domainsList.some(pattern => {
17
+ const normalized = pattern.toLowerCase()
18
+ if(normalized.includes("*")) {
19
+ const regex = new RegExp(
20
+ "^" +
21
+ normalized
22
+ .replace(/\./g, "\\.")
23
+ .replace(/\*/g, ".*")
24
+ + "$"
25
+ )
26
+ return regex.test(domain)
27
+ }
28
+ })
29
+
30
30
  }
package/package.json CHANGED
@@ -1,45 +1,48 @@
1
- {
2
- "name": "email-disposable",
3
- "description": "A regularly updated list of disposable and temporary email domains.",
4
- "packageManager": "yarn@4.10.3",
5
- "main": "index.js",
6
- "author": {
7
- "name": "Gatekeepr",
8
- "url": "https://gatekeepr.ro"
9
- },
10
- "files": [
11
- "index.js",
12
- "src/",
13
- "disposable.json",
14
- "disposable.txt"
15
- ],
16
- "version": "1.0.1",
17
- "devDependencies": {
18
- "p-limit": "^7.2.0"
19
- },
20
- "type": "module",
21
- "scripts": {
22
- "fetch": "node src/fetch.js"
23
- },
24
- "homepage": "https://github.com/gtkppr/email-disposable",
25
- "keywords": [
26
- "disposable",
27
- "email",
28
- "temporary email",
29
- "temp mail",
30
- "throwaway email",
31
- "fake email",
32
- "email validation",
33
- "email check",
34
- "email verifier",
35
- "email blacklist",
36
- "blocklist",
37
- "spam prevention",
38
- "signup validation",
39
- "email domains",
40
- "anti-spam",
41
- "anti-fraud",
42
- "gatekeepr"
43
- ],
44
- "license": "MIT"
45
- }
1
+ {
2
+ "name": "email-disposable",
3
+ "description": "A regularly updated list of disposable and temporary email domains.",
4
+ "packageManager": "yarn@4.10.3",
5
+ "main": "index.js",
6
+ "author": {
7
+ "name": "Gatekeepr",
8
+ "url": "https://gatekeepr.io"
9
+ },
10
+ "files": [
11
+ "index.js",
12
+ "src/",
13
+ "disposable.json",
14
+ "disposable.txt"
15
+ ],
16
+ "version": "1.0.3",
17
+ "devDependencies": {
18
+ "p-limit": "^7.2.0"
19
+ },
20
+ "type": "module",
21
+ "scripts": {
22
+ "fetch": "node src/fetch.js"
23
+ },
24
+ "homepage": "https://github.com/gtkppr/email-disposable",
25
+ "keywords": [
26
+ "disposable",
27
+ "email",
28
+ "temporary email",
29
+ "temp mail",
30
+ "throwaway email",
31
+ "fake email",
32
+ "email validation",
33
+ "email check",
34
+ "email verifier",
35
+ "email blacklist",
36
+ "blocklist",
37
+ "spam prevention",
38
+ "signup validation",
39
+ "email domains",
40
+ "anti-spam",
41
+ "anti-fraud",
42
+ "gatekeepr"
43
+ ],
44
+ "license": "MIT",
45
+ "repository": {
46
+ "url": "https://github.com/gtkppr/email-disposable"
47
+ }
48
+ }