inboxok 0.0.0-stage → 1.0.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package are documented here. This project follows [Semantic Versioning](https://semver.org/).
4
+
5
+ ## 1.0.0 - Unreleased
6
+
7
+ First release.
8
+
9
+ - `inboxok()` / `validate()` return `{ valid, reason, message, email, local, domain, suggestion, disposable, free, role }`: a reason code for code and a human message for users (*Email address is missing an @.*).
10
+ - Practical RFC 5321/5322 syntax: 64-byte local part, 254-byte address, 63-byte labels (Unicode labels measured as punycode), dot and hyphen rules, valid domain endings.
11
+ - Unicode addresses on by default (`allowUnicode`), quoted local parts (`allowQuoted`) and IP literals (`allowIp`) opt-in, `requireTld`.
12
+ - Rejects zero-width, non-breaking and control characters with a clear message.
13
+ - Curated list of ~430 disposable inbox domains with subdomain matching (`blockDisposable`, on by default), plus `blockDomains` and `allowDomains`.
14
+ - Typo suggestions for popular providers and misspelled endings (`gmial.com`, `gmail.con`, `gmail,com`, `gmailcom`), with your own `domains`; real domains like `email.com` and `acme.co` are left alone.
15
+ - Free-provider (`blockFree`, `isFreeProvider`) and role-account (`blockRole`, `isRole`) detection.
16
+ - `messages` option with `{email}`, `{local}`, `{domain}`, `{suggestion}` placeholders for translations.
17
+ - `isEmail()`, `suggest()`, `normalize()` (lowercase, `+tags`, Gmail dots), `isDisposable()`.
18
+ - No regular expressions over the whole input (no ReDoS), synchronous, no DNS, no `node:` imports: browsers, edge runtimes and Node.
19
+ - ESM + CommonJS, zero dependencies.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,401 @@
1
- # Temporary Holding Version
1
+ # inboxok
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Email validation for forms: checks the syntax, blocks throwaway inboxes and catches typos.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/inboxok.svg)](https://www.npmjs.com/package/inboxok) [![bundle size](https://img.shields.io/bundlephobia/minzip/inboxok)](https://bundlephobia.com/package/inboxok) [![license](https://img.shields.io/npm/l/inboxok.svg)](LICENSE)
6
+
7
+ Many email validators only return `true` or `false`. inboxok tells you why an address failed, gives you a message you can show to the user, and suggests a fix for common typos (*Did you mean ana@gmail.com?*). It is synchronous and uses no network, so you can run it in the browser while the user types, and again on the server.
8
+
9
+ > Need DNS/MX checks on the server? Use [validmail](https://www.npmjs.com/package/validmail). inboxok is the fast check you run in the form. validmail does the network lookups on the server.
10
+
11
+ ## Features
12
+
13
+ - **Clear errors**: a `reason` code for your code and a `message` for your users, not just `false`.
14
+ - **Typo suggestions**: `gmial.com`, `hotmal.com`, `gmail.con`, `gmail,com` and `gmailcom` become the right address. Real domains like `email.com` or `acme.co` are left alone.
15
+ - **Disposable email blocking**: a list of about 430 throwaway inbox providers (subdomains match too), plus your own block and allow lists.
16
+ - **Practical syntax rules**: RFC 5321/5322 length limits, dot rules, valid domain endings, Unicode addresses (`josé@exämple.de`). Quoted local parts and IP addresses are opt-in.
17
+ - **Catches copy-paste junk**: zero-width spaces, non-breaking spaces and control characters.
18
+ - **Role and free-provider detection**: `admin@`, `noreply@`; Gmail, Outlook, Yahoo and more, for "use your work email" forms.
19
+ - **`normalize()` for duplicates**: `A.Na+news@GoogleMail.com` becomes `ana@gmail.com`.
20
+ - **Safe on any input**: no regular expressions over the whole input, so no ReDoS (a slow-regex attack). A 100,000-character input takes well under a millisecond.
21
+ - **Runs anywhere**: browsers, edge runtimes, Node.js, Bun and Deno. Zero dependencies, about 8 KB gzipped including the lists.
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ npm install inboxok
27
+ ```
28
+
29
+ ```sh
30
+ pnpm add inboxok
31
+ yarn add inboxok
32
+ bun add inboxok
33
+ ```
34
+
35
+ ## Quick start
36
+
37
+ ```js
38
+ import inboxok from 'inboxok'
39
+ // CommonJS: const inboxok = require('inboxok')
40
+
41
+ inboxok('ana@example.com').valid
42
+ // => true
43
+
44
+ inboxok('ana@gmial.com').message
45
+ // => 'Did you mean ana@gmail.com?'
46
+
47
+ inboxok('ana@mailinator.com')
48
+ // => { valid: false, reason: 'disposable', message: 'Disposable email addresses are not allowed.', ... }
49
+
50
+ inboxok('ana@@example.com').message
51
+ // => 'Email address can only have one @.'
52
+
53
+ inboxok('ana@gmail,com').message
54
+ // => 'Email address can\'t contain ",". Did you mean ana@gmail.com?'
55
+ ```
56
+
57
+ ## Table of contents
58
+
59
+ - [Usage](#usage)
60
+ - [Validate a sign-up form](#validate-a-sign-up-form)
61
+ - [Show a "Did you mean ...?" hint](#show-a-did-you-mean--hint)
62
+ - [Block disposable emails](#block-disposable-emails)
63
+ - [Ask for a work email](#ask-for-a-work-email)
64
+ - [Normalize emails to find duplicates](#normalize-emails-to-find-duplicates)
65
+ - [Use custom or translated error messages](#use-custom-or-translated-error-messages)
66
+ - [API](#api)
67
+ - [Comparison](#comparison)
68
+ - [Notes and limitations](#notes-and-limitations)
69
+ - [Requirements](#requirements)
70
+ - [License](#license)
71
+
72
+ ## Usage
73
+
74
+ ### Validate a sign-up form
75
+
76
+ `validate()` (the same function as the default export) never throws. It returns `valid`, a `reason` code when the address is invalid, and a `message` for the user.
77
+
78
+ ```js
79
+ import { validate } from 'inboxok'
80
+
81
+ function checkEmail(value) {
82
+ const result = validate(value)
83
+ if (!result.valid) return { error: result.message }
84
+ return { email: result.email } // trimmed, domain lowercased
85
+ }
86
+
87
+ checkEmail('')
88
+ // => { error: 'Enter an email address.' }
89
+
90
+ checkEmail('ana silva@example.com')
91
+ // => { error: "Email address can't contain spaces." }
92
+
93
+ checkEmail(' Ana@Example.COM ')
94
+ // => { email: 'Ana@example.com' }
95
+ ```
96
+
97
+ Any value works as input. `null` and `undefined` give `reason: 'empty'`. Other non-strings (a number, a `File` from `FormData`) give `reason: 'syntax'`.
98
+
99
+ ### Show a "Did you mean ...?" hint
100
+
101
+ When the domain looks misspelled, the result has a `suggestion`. The address can still be valid (`gmial.com` is a real domain shape), so show the hint without blocking the form.
102
+
103
+ ```js
104
+ import { validate, suggest } from 'inboxok'
105
+
106
+ const result = validate('ana@gmial.com')
107
+ result.valid // => true
108
+ result.suggestion // => 'ana@gmail.com'
109
+ result.message // => 'Did you mean ana@gmail.com?'
110
+
111
+ // Or get only the suggestion:
112
+ suggest('ana@hotmal.com') // => 'ana@hotmail.com'
113
+ suggest('ana@gmail.con') // => 'ana@gmail.com'
114
+ suggest('ana@email.com') // => undefined (a real provider, not a typo)
115
+ ```
116
+
117
+ Add your own domains so that typos of them are caught too:
118
+
119
+ ```js
120
+ suggest('ana@acmecrop.com', { domains: ['acmecorp.com'] })
121
+ // => 'ana@acmecorp.com'
122
+ ```
123
+
124
+ ### Block disposable emails
125
+
126
+ Disposable (throwaway) addresses are rejected by default. Subdomains match too. The result always has a `disposable` flag, even when you turn blocking off.
127
+
128
+ ```js
129
+ import { validate, isDisposable } from 'inboxok'
130
+
131
+ validate('ana@mailinator.com').reason
132
+ // => 'disposable'
133
+
134
+ validate('ana@mailinator.com', { blockDisposable: false }).disposable
135
+ // => true
136
+
137
+ isDisposable('inbox.mailinator.com')
138
+ // => true
139
+ ```
140
+
141
+ Add your own domains with `blockDomains`, or make exceptions with `allowDomains`:
142
+
143
+ ```js
144
+ validate('ana@sub.example.com', { blockDomains: ['example.com'] }).message
145
+ // => 'Email addresses from sub.example.com are not allowed.'
146
+
147
+ validate('ana@mailinator.com', { allowDomains: ['mailinator.com'] }).valid
148
+ // => true
149
+ ```
150
+
151
+ The built-in list is small on purpose. It covers the providers people actually use (Mailinator, Guerrilla Mail, 10 Minute Mail, YOPmail, Temp-Mail, TrashMail, Maildrop and others), and every entry is on both of the big community lists. If you need full coverage, pass a bigger list to `blockDomains`.
152
+
153
+ ### Ask for a work email
154
+
155
+ Use `blockFree` to reject free providers such as Gmail, and `blockRole` to reject shared mailboxes such as `admin@`.
156
+
157
+ ```js
158
+ import { validate, isFreeProvider, isRole } from 'inboxok'
159
+
160
+ validate('ana@gmail.com', { blockFree: true }).message
161
+ // => 'Use your work email address.'
162
+
163
+ validate('admin@acme.com', { blockRole: true }).message
164
+ // => 'Use a personal email address, not a shared one like admin@.'
165
+
166
+ isFreeProvider('ana@outlook.com') // => true
167
+ isRole('no-reply@acme.com') // => true
168
+ ```
169
+
170
+ ### Normalize emails to find duplicates
171
+
172
+ `normalize()` turns different spellings of the same inbox into one value, so one person cannot create many accounts. Store the original address for sending mail, and the normalized one for lookups.
173
+
174
+ ```js
175
+ import { normalize } from 'inboxok'
176
+
177
+ normalize(' A.Na+news@GoogleMail.com ')
178
+ // => 'ana@gmail.com'
179
+
180
+ normalize('Ana.Silva+shop@Example.com')
181
+ // => 'ana.silva@example.com'
182
+
183
+ normalize('Ana+x@Example.com', { lowercase: false, plusTags: false })
184
+ // => 'Ana+x@example.com'
185
+ ```
186
+
187
+ `normalize()` does not validate. Call `validate()` first.
188
+
189
+ ### Use custom or translated error messages
190
+
191
+ Pass `messages` to replace the built-in English text. You can use the placeholders `{email}`, `{local}`, `{domain}` and `{suggestion}`.
192
+
193
+ ```js
194
+ import { validate } from 'inboxok'
195
+
196
+ const messages = {
197
+ syntax: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',
198
+ disposable: 'Wegwerf-Adressen von {domain} sind nicht erlaubt.',
199
+ suggestion: 'Meinten Sie {suggestion}?',
200
+ }
201
+
202
+ validate('ana@mailinator.com', { messages }).message
203
+ // => 'Wegwerf-Adressen von mailinator.com sind nicht erlaubt.'
204
+
205
+ validate('ana@gmial.com', { messages }).message
206
+ // => 'Meinten Sie ana@gmail.com?'
207
+ ```
208
+
209
+ The built-in messages are more specific than one per reason (*Email address can't contain spaces.*, *...two dots in a row.*). Setting a reason replaces all of its messages. When an invalid address also has a suggestion, the two messages are joined with a space. If you want your own layout, use `reason` and `suggestion` directly.
210
+
211
+ ## API
212
+
213
+ All functions are named exports. The default export is `validate`, and it also carries every function as a property: `inboxok.isEmail`, `inboxok.suggest` and so on.
214
+
215
+ ### validate(email, options?)
216
+
217
+ ```ts
218
+ function validate(email: unknown, options?: ValidateOptions): ValidationResult
219
+ // default export: inboxok(email, options?) is the same function
220
+ ```
221
+
222
+ Checks an address and explains the problem, if any. It never throws.
223
+
224
+ | Option | Type | Default | Description |
225
+ |---|---|---|---|
226
+ | `allowUnicode` | `boolean` | `true` | Accept non-ASCII letters: `josé@exämple.de`, `用户@例子.中国`. Punycode (`xn--`) is always accepted. |
227
+ | `allowQuoted` | `boolean` | `false` | Accept quoted local parts: `"ana silva"@example.com`. |
228
+ | `allowIp` | `boolean` | `false` | Accept IP addresses: `ana@[192.168.0.1]`, `ana@[IPv6:2001:db8::1]`, `ana@192.168.0.1`. |
229
+ | `requireTld` | `boolean` | `true` | Require a dot and a valid ending (TLD) in the domain. `false` accepts `ana@localhost`. |
230
+ | `blockDisposable` | `boolean` | `true` | Reject throwaway inbox providers. |
231
+ | `blockFree` | `boolean` | `false` | Reject free providers (Gmail, Outlook, Yahoo, iCloud, GMX, ISPs and others). |
232
+ | `blockRole` | `boolean` | `false` | Reject role mailboxes (`admin`, `noreply`, `support`, `info`, `sales` and others). |
233
+ | `blockDomains` | `readonly string[]` | `[]` | Extra domains to reject with reason `'blocked'`. Subdomains match too. |
234
+ | `allowDomains` | `readonly string[]` | `[]` | Domains that are never flagged as disposable, blocked or free, and never "corrected". Subdomains match too. This does not restrict other domains. |
235
+ | `suggest` | `boolean` | `true` | Suggest corrections for misspelled domains. |
236
+ | `domains` | `readonly string[]` | `[]` | Extra domains for suggestions, checked before the built-in list. |
237
+ | `messages` | `Partial<Record<MessageKey, string>>` | English | Your own messages, per `reason` plus `suggestion`. See [custom messages](#use-custom-or-translated-error-messages). |
238
+
239
+ Domain lists accept `'example.com'`, `'@example.com'` or `'*.example.com'`, in any case.
240
+
241
+ #### The result
242
+
243
+ ```ts
244
+ {
245
+ valid: boolean
246
+ reason?: Reason // set only when valid is false
247
+ email: string // trimmed, domain lowercased, Unicode in NFC form
248
+ local: string // the part before the @
249
+ domain: string // the lowercased part after the @
250
+ message: string // text for your users; '' when valid with no suggestion
251
+ suggestion?: string // corrected address; can also be set on invalid results
252
+ disposable: boolean // these three flags are set even when the matching
253
+ free: boolean // block option is off
254
+ role: boolean
255
+ }
256
+ ```
257
+
258
+ #### Reasons
259
+
260
+ | `reason` | When | Example default `message` |
261
+ |---|---|---|
262
+ | `'empty'` | `''`, only spaces, `null`, `undefined` | Enter an email address. |
263
+ | `'syntax'` | missing or extra `@`, spaces, bad characters, misplaced dots | Email address is missing an @. |
264
+ | `'too_long'` | over 64 bytes before the `@`, over 254 in total, or a domain label over 63 | The part before the @ is too long. |
265
+ | `'domain'` | invalid domain name | Domain names can't start or end with a hyphen. |
266
+ | `'tld'` | no ending (`ana@gmail`) or an invalid one (`.c`, `.c0m`) | The domain "gmail" needs an ending like .com. |
267
+ | `'ip'` | an IP address, and `allowIp` is off | Use a domain name, not an IP address. |
268
+ | `'unicode'` | non-ASCII characters, and `allowUnicode` is off | Email address can't contain "é". |
269
+ | `'disposable'` | a throwaway inbox, and `blockDisposable` is on (default) | Disposable email addresses are not allowed. |
270
+ | `'blocked'` | the domain is in `blockDomains` | Email addresses from example.com are not allowed. |
271
+ | `'free'` | a free provider, and `blockFree` is on | Use your work email address. |
272
+ | `'role'` | a role mailbox, and `blockRole` is on | Use a personal email address, not a shared one like admin@. |
273
+
274
+ ### isEmail(email, options?)
275
+
276
+ ```ts
277
+ function isEmail(email: unknown, options?: ValidateOptions): boolean
278
+ ```
279
+
280
+ Returns `validate(email, options).valid`, without computing suggestions. With the default options this also rejects disposable domains. Pass `{ blockDisposable: false }` for a syntax-only check.
281
+
282
+ ### suggest(email, options?)
283
+
284
+ ```ts
285
+ function suggest(email: string, options?: SuggestOptions): string | undefined
286
+ ```
287
+
288
+ Returns the corrected address, or `undefined` when there is nothing to fix.
289
+
290
+ | Option | Type | Default | Description |
291
+ |---|---|---|---|
292
+ | `domains` | `readonly string[]` | `[]` | Extra domains to suggest, checked before the built-in list. |
293
+
294
+ How it decides: the name and the ending are compared separately. Swapped letters (`gmial`) count as one typo. Long names like `hotmail` allow one typo, very long names like `protonmail` allow two, and short names like `aol` or `web` only get a misspelled ending fixed (`aol.con`). This way ordinary domains are not "corrected" into big providers. Known providers (about 280, including regional ones like `hotmail.ca` and `gmx.de`) are never corrected.
295
+
296
+ ```js
297
+ suggest('ana@yahoo.co') // => 'ana@yahoo.com'
298
+ suggest('ana@gmailcom') // => 'ana@gmail.com'
299
+ suggest('ana@hotmial.fr') // => 'ana@hotmail.fr'
300
+ suggest('ana@acme.con') // => 'ana@acme.com' (.con, .cmo, .nte, .ogr are not real endings)
301
+ suggest('ana@acme.co') // => undefined (.co is a real ending)
302
+ ```
303
+
304
+ ### normalize(email, options?)
305
+
306
+ ```ts
307
+ function normalize(email: string, options?: NormalizeOptions): string
308
+ ```
309
+
310
+ Trims the address, lowercases it and removes `+tags` and Gmail dots. The domain is always lowercased. Quoted local parts are left as they are. Throws a `TypeError` if `email` is not a string.
311
+
312
+ | Option | Type | Default | Description |
313
+ |---|---|---|---|
314
+ | `lowercase` | `boolean` | `true` | Lowercase the local part too. |
315
+ | `plusTags` | `boolean` | `true` | Remove `+tags` on every domain: `ana+news@example.com` becomes `ana@example.com`. |
316
+ | `gmailDots` | `boolean` | `true` | Remove dots in Gmail addresses, and treat `googlemail.com` as `gmail.com`. |
317
+
318
+ ### isDisposable(emailOrDomain), isFreeProvider(emailOrDomain), isRole(emailOrLocal)
319
+
320
+ ```ts
321
+ function isDisposable(emailOrDomain: string): boolean
322
+ function isFreeProvider(emailOrDomain: string): boolean
323
+ function isRole(emailOrLocal: string): boolean
324
+ ```
325
+
326
+ Check a full address, a bare domain or a bare local part against the built-in lists. `isDisposable` also matches subdomains. `isRole` ignores `.`, `-` and `_`, and removes `+tags`.
327
+
328
+ ```js
329
+ isDisposable('ana@mailinator.com') // => true
330
+ isFreeProvider('ana@acme.com') // => false
331
+ isRole('noreply@acme.com') // => true
332
+ ```
333
+
334
+ ### Built-in lists
335
+
336
+ ```ts
337
+ const disposableDomains: readonly string[] // throwaway inbox domains
338
+ const freeProviders: readonly string[] // free providers and ISPs
339
+ const popularDomains: readonly string[] // domains used for typo suggestions, most popular first
340
+ const roleAccounts: readonly string[] // role names, without '.', '-' and '_'
341
+ ```
342
+
343
+ All lists are frozen arrays.
344
+
345
+ ### Types
346
+
347
+ ```ts
348
+ import type {
349
+ ValidationResult, // ValidResult | InvalidResult, narrowed by `valid`
350
+ ValidResult,
351
+ InvalidResult,
352
+ Reason, // 'empty' | 'syntax' | 'too_long' | ... | 'role'
353
+ MessageKey, // Reason | 'suggestion'
354
+ ValidateOptions,
355
+ SuggestOptions,
356
+ NormalizeOptions,
357
+ Inboxok, // type of the default export
358
+ } from 'inboxok'
359
+ ```
360
+
361
+ ## Comparison
362
+
363
+ Each of these packages does one part of the job. inboxok does all four in one small synchronous call.
364
+
365
+ | | `email-validator` | `validator.isEmail` | `mailcheck` | `disposable-email-domains` | inboxok |
366
+ |---|---|---|---|---|---|
367
+ | Syntax check | Yes | Yes | No | No | Yes |
368
+ | Says why it failed | No (`boolean`) | No (`boolean`) | - | - | Yes (`reason` + `message`) |
369
+ | `josé@exämple.de` | No (rejected) | Yes | - | - | Yes |
370
+ | Rejects `ana@example.c0m` | No (accepted) | Yes | - | - | Yes |
371
+ | Rejects a trailing zero-width space | Yes | No (accepted) | - | - | Yes |
372
+ | Disposable domains | No | No | No | Yes (121k domains, 2.4 MB JSON) | Yes (~430 curated, ~8 KB total) |
373
+ | Matches `x.mailinator.com` (subdomain) | - | No (`host_blacklist` is exact) | - | No (not in the main list) | Yes |
374
+ | Typo suggestions | No | No | Yes | No | Yes |
375
+ | Suggestion for `ana@gmal.con` | - | - | `ana@gmx.com` | - | `ana@gmail.com` |
376
+ | `ana@email.com`, `ana@acme.co` (real domains) | - | - | Suggests `gmail.com`, `acme.com` | - | No suggestion |
377
+ | Role / free-provider detection | No | No | No | No | Yes |
378
+ | TypeScript types | Yes | `@types/validator` | `@types/mailcheck` | - | Yes (built in) |
379
+
380
+ Checked against `email-validator` 2.0.4, `validator` 13.15, `mailcheck` 1.1.1 and `disposable-email-domains` 1.0.62.
381
+
382
+ If you need full disposable coverage, `disposable-email-domains` has a much bigger list. You can pass it to the `blockDomains` option.
383
+
384
+ ## Notes and limitations
385
+
386
+ - inboxok checks that an address is well formed and worth sending to, without the network. It cannot tell if the domain accepts mail or if the mailbox exists. That needs DNS/SMTP checks on a server (see [validmail](https://www.npmjs.com/package/validmail)).
387
+ - Comments (`ana(work)@example.com`) and other obsolete RFC 5322 forms are rejected.
388
+ - Domain endings are checked for shape (letters, at least two, or `xn--`), not against the official IANA list. So `ana@example.zzz` passes.
389
+ - Unicode domain labels are length-checked in their punycode form. Full IDNA2008/UTS 46 checks (mixed scripts, right-to-left rules) are not done.
390
+ - Privacy relays that forward to a real inbox (`duck.com`, Apple's Hide My Email, SimpleLogin, Firefox Relay) are not on the disposable list. People use them for accounts they keep.
391
+
392
+ ## Requirements
393
+
394
+ - Node.js 20 or newer. Also runs in browsers, edge runtimes, Bun and Deno (no `node:` imports, no DNS).
395
+ - ESM and CommonJS builds.
396
+ - TypeScript types included.
397
+ - Zero dependencies.
398
+
399
+ ## License
400
+
401
+ MIT
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var w=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var re=Object.prototype.hasOwnProperty;var ce=(e,o)=>{for(var a in o)w(e,a,{get:o[a],enumerable:!0})},de=(e,o,a,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of se(o))!re.call(e,n)&&n!==a&&w(e,n,{get:()=>o[n],enumerable:!(t=me(o,n))||t.enumerable});return e};var fe=e=>de(w({},"__esModule",{value:!0}),e);var Te={};ce(Te,{default:()=>Se,disposableDomains:()=>U,freeProviders:()=>$,isDisposable:()=>te,isEmail:()=>ee,isFreeProvider:()=>ie,isRole:()=>ne,normalize:()=>ae,popularDomains:()=>V,roleAccounts:()=>N,suggest:()=>oe,validate:()=>k});module.exports=fe(Te);var T="0-mail.com 0815.ru 0815.su 0clickemail.com 0wnd.net 0wnd.org 10mail.org 10minemail.com 10minutemail.be 10minutemail.cf 10minutemail.co.uk 10minutemail.com 10minutemail.de 10minutemail.net 10minutesmail.com 1pad.de 1secmail.com 1secmail.net 1secmail.org 20email.eu 20minutemail.com 20minutemail.it 30minutemail.com 4warding.com 4warding.net 4warding.org 60minutemail.com amilegit.com anonbox.net anonymbox.com antispam.de armyspy.com bccto.me binkmail.com bobmail.info brefmail.com bumpymail.com byom.de chacuo.net chammy.info cheatmail.de courriel.fr.nf courrieltemporaire.com crazymailing.com cuvox.de dayrep.com deadaddress.com deadspam.com despam.it despammed.com devnullmail.com discard.email discardmail.com discardmail.de dispomail.eu disposableaddress.com disposableemailaddresses.com disposableinbox.com disposeamail.com disposemail.com dispostable.com dodgeit.com dodgit.com dontreg.com dontsendmespam.de drdrb.net dropmail.me dump-email.info dumpandjunk.com dumpmail.de dumpyemail.com easytrashmail.com einrot.com einrot.de emailfake.com emailgenerator.de emailinfive.com emailmiser.com emailnax.com emailondeck.com emailsensei.com emailtemporanea.com emailtemporanea.net emailtemporar.ro emailtemporario.com.br emailtmp.com emailwarden.com emailxfer.com emlhub.com emlpro.com emltmp.com ephemail.net esiix.com etranquil.com etranquil.net etranquil.org explodemail.com fakeinbox.com fakeinformation.com fakemail.fr fakemail.net fakemailgenerator.com fexbox.org fexpost.com fextemp.com filzmail.com fizmail.com fleckens.hu fr33mail.info frapmail.com friendlymail.co.uk get1mail.com get2mail.fr getairmail.com getnada.cc getnada.com getonemail.com getonemail.net grr.la gsrv.co.uk guerillamail.biz guerillamail.com guerillamail.de guerillamail.info guerillamail.net guerillamail.org guerrillamail.biz guerrillamail.com guerrillamail.de guerrillamail.info guerrillamail.net guerrillamail.org guerrillamailblock.com gustr.com haltospam.com harakirimail.com hatespam.org hidemail.de hmamail.com hulapla.de ieatspam.eu ieatspam.info imails.info inboxalias.com inboxbear.com inboxclean.com inboxclean.org inboxkitten.com incognitomail.com incognitomail.net incognitomail.org instant-mail.de jetable.com jetable.fr.nf jetable.net jetable.org jourrapide.com kasmail.com killmail.com killmail.net koszmail.pl kurzepost.de letthemeatspam.com linshiyouxiang.net litedrop.com lookugly.com lortemail.dk m4ilweb.info mail-temp.com mail-temporaire.fr mail4trash.com mail7.io mailbidon.com mailbox.in.ua mailcatch.com maildrop.cc maileater.com mailexpire.com mailfa.tk mailforspam.com mailfreeonline.com mailguard.me mailhazard.com mailhazard.us mailhz.me mailimate.com mailin8r.com mailinater.com mailinator.com mailinator.net mailinator.org mailinator.us mailinator2.com mailincubator.com mailismagic.com mailme24.com mailmetrash.com mailnator.com mailnesia.com mailnull.com mailpoof.com mailquack.com mailrock.biz mailsac.com mailscrap.com mailsiphon.com mailslapping.com mailslite.com mailtemp.info mailtothis.com mailzilla.com mailzilla.org mega.zik.dj meltmail.com mintemail.com minuteinbox.com moakt.cc moakt.com moakt.ws mohmal.com moncourrier.fr.nf monemail.fr.nf monmail.fr.nf monumentmail.com mt2015.com mvrht.com mvrht.net mycleaninbox.net myphantomemail.com mytemp.email mytempemail.com mytempmail.com mytrashmail.com nada.email no-spam.ws noclickemail.com nogmailspam.info nomail.xl.cx nomail2me.com nomorespamemails.com nospam.ze.tc nospam4.us nospamfor.us nospamthanks.info notmailinator.com nowmymail.com nurfuerspam.de objectmail.com oneoffemail.com onewaymail.com owlpic.com pancakemail.com pokemail.net pookmail.com proxymail.eu putthisinyourspamdatabase.com quickinbox.com rcpt.at reallymymail.com receiveee.com rejectmail.com rhyta.com rmqkr.net rppkn.com safetymail.info selfdestructingmail.com sendspamhere.com sharklasers.com shitmail.me shortmail.net skeefmail.com slaskpost.se slopsbox.com smailpro.com smashmail.de smellfear.com snakemail.com sofimail.com sogetthis.com spam.la spam.su spam4.me spamavert.com spambob.com spambob.net spambob.org spambog.com spambog.de spambog.ru spambox.info spambox.me spambox.us spamcero.com spamcorptastic.com spamcowboy.com spamcowboy.net spamcowboy.org spamday.com spamdecoy.net spamfree.eu spamfree24.com spamfree24.de spamfree24.eu spamfree24.info spamfree24.net spamfree24.org spamherelots.com spamhereplease.com spamhole.com spamify.com spamkill.info spaml.com spaml.de spamobox.com spamspot.com spamstack.net spamthis.co.uk spamthisplease.com spamtrail.com speed.1s.fr streetwisemail.com supergreatmail.com supermailer.jp superrito.com suremail.info tagyourself.com teleworm.com teleworm.us temp-mail.com temp-mail.de temp-mail.org temp-mail.ru temp-mails.com tempail.com tempalias.com tempemail.biz tempemail.com tempemail.net tempinbox.co.uk tempinbox.com tempm.com tempmail.de tempmail.dev tempmail.email tempmail.io tempmail.it tempmail.ninja tempmail.plus tempmail.us tempmail2.com tempmailer.com tempmailer.de tempmailin.com tempmailo.com tempmails.net tempomail.fr temporarily.de temporarioemail.com.br temporaryemail.net temporaryemail.us temporaryforwarding.com temporaryinbox.com temporarymailaddress.com tempr.email tempsky.com thanksnospam.info thankyou2010.com thisisnotmyrealemail.com throwam.com throwawayemailaddress.com throwawaymail.com tmail.ws tmailinator.com tmails.net tmpeml.com tmpmail.net tmpmail.org tradermail.info trash-amil.com trash-mail.at trash-mail.com trash-mail.de trash-me.com trash2009.com trashdevil.com trashdevil.de trashemail.de trashinbox.com trashmail.at trashmail.com trashmail.de trashmail.io trashmail.me trashmail.net trashmail.org trashmail.ws trashmailer.com trashymail.com trashymail.net twinmail.de venompen.com veryrealemail.com viditag.com webm4il.info wegwerfadresse.de wegwerfemail.de wegwerfmail.de wegwerfmail.net wegwerfmail.org whyspam.me wilemail.com willselfdestruct.com wuzup.net wuzupmail.net wwjmp.com wwwnew.eu xmaily.com xojxe.com yoggm.com yopmail.com yopmail.fr yopmail.gq yopmail.net zehnminuten.de zehnminutenmail.de zetmail.com zippymail.info",j="126.com 139.com 163.com 189.cn abv.bg aim.com aliceadsl.fr alice.it aliyun.com aol.com aol.co.uk aol.de aol.fr aol.it arcor.de atlas.cz att.net azet.sk bbox.fr bellsouth.net bigmir.net bigpond.com bigpond.net.au bk.ru bluewin.ch blueyonder.co.uk bol.com.br btinternet.com centrum.cz centurylink.net charter.net citromail.hu club-internet.fr comcast.net consultant.com cox.net daum.net dir.bg disroot.org dr.com earthlink.net email.com email.cz email.it engineer.com fastmail.com fastmail.fm foxmail.com free.fr freemail.hu freenet.de frontier.com games.com gazeta.pl globo.com globomail.com gmail.com gmx.at gmx.ch gmx.com gmx.co.uk gmx.de gmx.es gmx.fr gmx.it gmx.net gmx.us googlemail.com hanmail.net hetnet.nl hey.com hispeed.ch home.nl hotmail.at hotmail.be hotmail.ca hotmail.ch hotmail.co.in hotmail.co.jp hotmail.com hotmail.com.ar hotmail.com.au hotmail.com.br hotmail.com.mx hotmail.co.uk hotmail.de hotmail.dk hotmail.es hotmail.fi hotmail.fr hotmail.gr hotmail.it hotmail.nl hotmail.no hotmail.se hushmail.com icloud.com ig.com.br inbox.com inbox.lv inbox.ru interia.pl internet.ru i.ua juno.com kakao.com kpnmail.nl laposte.net libero.it list.ru live.at live.be live.ca live.cl live.cn live.com live.com.ar live.com.au live.com.mx live.co.uk live.co.za live.de live.dk live.fr live.ie live.in live.it live.jp live.nl live.no live.se love.com mac.com mail.bg mailbox.org mail.com mailfence.com mail.ru me.com meta.ua msn.com myself.com nate.com naver.com netzero.net neuf.fr ntlworld.com o2.pl onet.pl op.pl optonline.net optusnet.com.au orange.fr outlook.at outlook.be outlook.cl outlook.co.id outlook.com outlook.com.ar outlook.com.au outlook.com.br outlook.com.mx outlook.co.nz outlook.co.th outlook.co.uk outlook.de outlook.dk outlook.es outlook.fr outlook.ie outlook.in outlook.it outlook.jp outlook.sa passport.com planet.nl pm.me post.com post.cz posteo.de posteo.net protonmail.ch protonmail.com proton.me qq.com rambler.ru rediffmail.com riseup.net roadrunner.com rocketmail.com rogers.com runbox.com sapo.pt sbcglobal.net seznam.cz sfr.fr shaw.ca sina.cn sina.com sky.com skynet.be sohu.com startmail.com sympatico.ca talktalk.net techie.com telenet.be telus.net terra.com.br tin.it tiscali.co.uk tiscali.it tlen.pl t-online.de tuta.com tuta.io tutamail.com tutanota.com tutanota.de twc.com ukr.net uol.com.br usa.com verizon.net videotron.ca vip.163.com vip.qq.com virgilio.it virginmedia.com walla.co.il walla.com wanadoo.fr web.de windowslive.com windstream.net wow.com wp.pl writeme.com xtra.co.nz yahoo.at yahoo.be yahoo.ca yahoo.co.id yahoo.co.in yahoo.co.jp yahoo.com yahoo.com.ar yahoo.com.au yahoo.com.br yahoo.com.hk yahoo.com.mx yahoo.com.ph yahoo.com.sg yahoo.com.tw yahoo.com.vn yahoo.co.nz yahoo.co.th yahoo.co.uk yahoo.co.za yahoo.de yahoo.dk yahoo.es yahoo.fr yahoo.gr yahoo.ie yahoo.in yahoo.it yahoo.nl yahoo.no yahoo.pl yahoo.se yandex.by yandex.com yandex.com.tr yandex.kz yandex.ru yandex.ua ya.ru yeah.net ygm.com ymail.com ziggo.nl zoho.com zohomail.com zohomail.eu",L="gmail.com yahoo.com hotmail.com outlook.com icloud.com aol.com live.com msn.com me.com mac.com googlemail.com ymail.com rocketmail.com protonmail.com proton.me comcast.net verizon.net att.net sbcglobal.net bellsouth.net charter.net earthlink.net optonline.net cox.net yahoo.co.uk hotmail.co.uk outlook.co.uk live.co.uk btinternet.com yahoo.co.in rediffmail.com yahoo.ca hotmail.ca yahoo.fr hotmail.fr outlook.fr live.fr orange.fr wanadoo.fr laposte.net yahoo.de hotmail.de outlook.de gmx.de gmx.net web.de t-online.de yahoo.es hotmail.es outlook.es yahoo.it hotmail.it libero.it yahoo.com.br hotmail.com.br uol.com.br bol.com.br yahoo.com.au bigpond.com yahoo.co.jp mail.ru yandex.ru qq.com 163.com fastmail.com tutanota.com zoho.com mail.com gmx.com",P="abuse admin administrator hostmaster postmaster webmaster webadmin root sysadmin noreply donotreply nobody mailerdaemon bounce bounces support help helpdesk techsupport info information contact contactus hello sales marketing billing accounts accounting finance invoices payments office team staff all everyone hr jobs careers recruiting recruitment security privacy legal compliance press media pr news newsletter notifications alerts feedback enquiries enquiry inquiries inquiry service services customerservice customercare customersupport care orders shop store booking bookings reservations admissions it tech dev devops ops operations mail email www ftp list listserv majordomo subscribe unsubscribe investors ir partners partnerships affiliates social community events membership members",q={con:"com",cpm:"com",cmo:"com",ocm:"com",vom:"com",xom:"com",comm:"com",coom:"com",cim:"com",c0m:"com",conm:"com",comn:"com",clm:"com",cok:"com",cpom:"com",comj:"com",ckm:"com",coim:"com",nte:"net",ner:"net",nett:"net",nwt:"net",ney:"net",nrt:"net",ogr:"org",rog:"org",orgg:"org",prg:"org"};var x=e=>Object.freeze(e.split(" ")),U=x(T),$=x(j),V=x(L),N=x(P),B=new Set(U),E=new Set($),W=new Set(N),ue=new Map(Object.entries(q)),Q=1024,pe="!#$%&'*+-/=?^_`{|}~",K=/\s|\p{Z}/u,R=/\p{C}/u,ge=/[\p{L}\p{M}\p{N}]/u,he=/^[\p{L}\p{M}]+$/u,I=/[^\x00-\x7f]/,C=/^[0-9a-f]{1,4}$/i,be=/\{(email|local|domain|suggestion|char)\}/g,X=e=>e>=48&&e<=57||e>=97&&e<=122||e>=65&&e<=90,ye=e=>{let o=0;for(let a of e){let t=a.codePointAt(0);o+=t<128?1:t<2048?2:t<65536?3:4}return o},H=e=>{let o=e.lastIndexOf("@");return(o<0?e:e.slice(o+1)).trim().toLowerCase()},Y=e=>{let o=String(e).trim().toLowerCase();return o.startsWith("@")&&(o=o.slice(1)),o.startsWith("*.")&&(o=o.slice(2)),o.startsWith(".")&&(o=o.slice(1)),o},D=new WeakMap,z=e=>{if(!e||e.length===0)return;let o=D.get(e);return o||D.set(e,o=new Set(e.map(Y))),o},h=(e,o)=>{if(!o||e.length>253)return!1;for(let a=e;;){if(o.has(a))return!0;let t=a.indexOf(".");if(t<0)return!1;a=a.slice(t+1)}},O=e=>{let o=e.split(".");return o.length===4&&o.every(a=>a.length>0&&a.length<=3&&/^\d+$/.test(a)&&(a==="0"||a[0]!=="0")&&+a<=255)},xe=e=>{if(e.length<2||e.length>45)return!1;if(e.includes(".")){let i=e.lastIndexOf(":");if(i<0||!O(e.slice(i+1)))return!1;e=e.slice(0,i+1)+"0:0"}let o=e.indexOf("::");if(o<0){let i=e.split(":");return i.length===8&&i.every(l=>C.test(l))}if(e.indexOf("::",o+1)>=0)return!1;let a=e.slice(0,o),t=e.slice(o+2),n=[...a?a.split(":"):[],...t?t.split(":"):[]];return n.length<=7&&n.every(i=>C.test(i))},ke=e=>{let o=Array.from(e,m=>m.codePointAt(0)),a=0;for(let m of o)m<128&&a++;let t=a;t&&a++;let n=128,i=0,l=72;for(let m=t;m<o.length;){let s=1/0;for(let r of o)r>=n&&r<s&&(s=r);i+=(s-n)*(m+1),n=s;for(let r of o)if(r<n&&i++,r===n){let c=i;for(let p=36;;p+=36){let g=p<=l?1:p>=l+26?26:p-l;if(c<g)break;a++,c=Math.floor((c-g)/(36-g))}a++;let d=m===t?Math.floor(i/700):i>>1;d+=Math.floor(d/(m+1));let u=0;for(;d>455;u+=36)d=Math.floor(d/35);l=Math.floor(u+36*d/(d+38)),i=0,m++}i++,n++}return a+4},y=(e,o,a)=>{if(e===o)return 0;if(Math.abs(e.length-o.length)>a)return a+1;let t=[],n=Array.from({length:o.length+1},(i,l)=>l);for(let i=1;i<=e.length;i++){let l=[i],m=i;for(let s=1;s<=o.length;s++){let r=Math.min(n[s]+1,l[s-1]+1,n[s-1]+(e[i-1]===o[s-1]?0:1));i>1&&s>1&&e[i-1]===o[s-2]&&e[i-2]===o[s-1]&&(r=Math.min(r,t[s-2]+1)),l.push(r),r<m&&(m=r)}if(m>a)return a+1;t=n,n=l}return n[o.length]},f={empty:"Enter an email address.",syntax:"Enter a valid email address.",too_long:"This email address is too long.",domain:'The domain "{domain}" is not valid.',tld:'The domain "{domain}" needs an ending like .com.',ip:"Use a domain name, not an IP address.",unicode:`Email address can't contain "{char}".`,disposable:"Disposable email addresses are not allowed.",blocked:"Email addresses from {domain} are not allowed.",free:"Use your work email address.",role:"Use a personal email address, not a shared one like {local}@.",suggestion:"Did you mean {suggestion}?"},G="Email address can't contain two dots in a row.",b=(e,o)=>e==="@"?["syntax","Email address can only have one @."]:K.test(e)?[o,"Email address can't contain spaces."]:R.test(e)?[o,"Email address contains an invisible or control character."]:[o,`Email address can't contain "{char}".`,e],Z=(e,o,a,t)=>{if(K.test(e)||R.test(e)||t&&!ge.test(e))return b(e,o);if(!a)return["unicode",f.unicode,e]},we=(e,o)=>{if(e[0]==="."||e[e.length-1]===".")return["syntax","The part before the @ can't start or end with a dot."];let a=!1;for(let t of e){if(t==="."){if(a)return["syntax",G];a=!0;continue}a=!1;let n=t.codePointAt(0);if(n<128){if(!X(n)&&!pe.includes(t))return b(t,"syntax")}else{let i=Z(t,"syntax",o,!1);if(i)return i}}},ve=(e,o)=>{let a=!1;for(let t of e){let n=t.codePointAt(0);if(n>=128){if(R.test(t))return b(t,"syntax");if(!o)return["unicode",f.unicode,t]}else{if(n<32||n===127)return b(t,"syntax");if(!a&&t==="\\"){a=!0;continue}}a=!1}},ze=(e,o)=>{if(!e)return{fail:["domain","Enter the domain after the @, like example.com."],length:0};if(e[0]==="["){if(e[e.length-1]!=="]")return{fail:["domain",f.domain],length:0};if(!o.allowIp)return{fail:["ip",f.ip],length:0};let l=e.slice(1,-1);return(l.startsWith("ipv6:")?xe(l.slice(5)):O(l))?{ip:!0,length:e.length}:{fail:["domain","The IP address {domain} is not valid."],length:0}}if(e[0]==="."||e[e.length-1]===".")return{fail:["domain","The domain can't start or end with a dot."],length:0};let a=e.split("."),t=a.length-1;for(let l of a){if(!l)return{fail:["domain",G],length:0};let m=!0;for(let r of l){let c=r.codePointAt(0);if(c<128){if(!X(c)&&r!=="-")return{fail:b(r,"domain"),length:0}}else{m=!1;let d=Z(r,"domain",o.allowUnicode,!0);if(d)return{fail:d,length:0}}}if(l[0]==="-"||l[l.length-1]==="-")return{fail:["domain","Domain names can't start or end with a hyphen."],length:0};let s=m?l.length:ke(l);if(s>63)return{fail:["too_long","The domain name is too long."],length:0};t+=s}if(t>253)return{fail:["too_long","The domain name is too long."],length:0};if(O(e))return o.allowIp?{ip:!0,length:t}:{fail:["ip",f.ip],length:0};let n=a[a.length-1];return a.length===1?o.requireTld?{fail:["tld",f.tld],length:0}:{length:t}:(I.test(n)?he.test(n)&&Array.from(n).length>=2:n.startsWith("xn--")?n.length>4:n.length>=2&&/^[a-z]+$/.test(n))?{length:t}:{fail:["tld",'The domain "{domain}" has an invalid ending.'],length:0}},S=(e,o)=>{let a=e.trim(),t={email:a,local:"",domain:"",quoted:!1,ip:!1,localOk:!1};if(!a)return{...t,fail:["empty",f.empty]};if(a.length>Q)return{...t,fail:["too_long",f.too_long]};I.test(a)&&(a=t.email=a.normalize("NFC"));let n,i,l=a[0]==='"';if(l){let u=-1;for(let p=1;p<a.length;p++)if(a[p]==="\\")p++;else if(a[p]==='"'){u=p;break}if(n=u+1,u<0||a[n]!=="@")return{...t,fail:["syntax",u<0?f.syntax:"Email address can only have one @."]}}else if(n=a.lastIndexOf("@"),n<0)return{...t,fail:["syntax","Email address is missing an @."]};let m=a.slice(0,n),s=a.slice(n+1).toLowerCase(),r=s.startsWith("[ipv6:")?"[IPv6:"+s.slice(6):s;Object.assign(t,{local:m,domain:r,quoted:l,email:m+"@"+r}),!m||m==='""'?i=["syntax","Enter the part before the @."]:l?i=o.allowQuoted?ve(m.slice(1,-1),o.allowUnicode):["syntax","Quoted email addresses are not allowed."]:i=we(m,o.allowUnicode);let c=ye(m);if(!i&&c>64&&(i=["too_long","The part before the @ is too long."]),i)return{...t,fail:i};t.localOk=!0;let d=ze(s,o);return d.fail?{...t,fail:d.fail}:(t.ip=!!d.ip,c+1+d.length>254?{...t,fail:["too_long",f.too_long]}:t)},_=e=>{let o=e.indexOf("."),a=o<0?e:e.slice(0,o);return{domain:e,sld:a,suffix:o<0?"":e.slice(o+1),flat:e.split(".").join(""),max:a.length<=4?0:a.length<=8?1:2}},v,A=new WeakMap,Oe=e=>{if(v??(v=V.map(_)),!e||e.length===0)return v;let o=A.get(e);return o||A.set(e,o=[...e.map(a=>_(Y(a))),...v]),o},Ee=e=>e.toLowerCase().replace(/\s/g,"").replace(/,/g,".").split(".").filter(Boolean).join("."),Re=(e,o,a)=>{if(!e||a(e))return;let t=e.indexOf(".");if(t<0){for(let c of o)if(y(e,c.sld,c.max)<=c.max||y(e,c.flat,c.max)<=c.max)return c.domain;return}let n=e.slice(0,t),i=e.slice(t+1),l=i.lastIndexOf("."),m=ue.get(i.slice(l+1));m&&(i=i.slice(0,l+1)+m);let s,r=1/0;for(let c of o){let d=y(n,c.sld,c.max);if(d>c.max)continue;let u=y(i,c.suffix,c.max?1:0);if(!(u>(c.max?1:0))&&d+u<r&&(s=c.domain,r=d+u,!r))break}return s!==void 0?s===e?void 0:s:m?`${n}.${i}`:void 0},Ie=(e,o,a)=>E.has(e)||h(e,a)||!!z(o)?.has(e),F={allowUnicode:!0,allowQuoted:!0,allowIp:!1,requireTld:!0},J=(e,o,a,t,n)=>{let i=Ee(o),l=Re(i,Oe(t),s=>Ie(s,t,n))??i;if(l===o)return;let m=`${e}@${l}`;return S(m,a).fail?void 0:m},M=(e,o)=>e.replace(be,(a,t)=>o[t]??"");function k(e,o={}){let a={allowUnicode:o.allowUnicode!==!1,allowQuoted:!!o.allowQuoted,allowIp:!!o.allowIp,requireTld:o.requireTld!==!1},t=typeof e=="string"?S(e,a):{email:"",local:"",domain:"",quoted:!1,ip:!1,localOk:!1,fail:e==null?["empty",f.empty]:["syntax",f.syntax]},n=z(o.allowDomains),i=t.fail,l=!1,m=!1,s=!1;if(!i){if(!t.ip&&!h(t.domain,n)&&(l=h(t.domain,B),m=E.has(t.domain),h(t.domain,z(o.blockDomains))&&(i=["blocked",f.blocked])),!t.quoted){let g=t.local.indexOf("+");s=W.has((g<0?t.local:t.local.slice(0,g)).toLowerCase().replace(/[._-]/g,""))}i||(l&&o.blockDisposable!==!1?i=["disposable",f.disposable]:m&&o.blockFree?i=["free",f.free]:s&&o.blockRole&&(i=["role",f.role]))}let r;o.suggest!==!1&&t.localOk&&!t.ip&&(!i||i[0]==="domain"||i[0]==="tld")&&(r=J(t.local,t.domain,a,o.domains,n));let c=o.messages??{},d={email:t.email,local:t.local,domain:t.domain,suggestion:r,char:i?.[2]},u=[];i&&u.push(M(c[i[0]]??i[1],d)),r&&u.push(M(c.suggestion??f.suggestion,d));let p={valid:!i,email:t.email,local:t.local,domain:t.domain,message:u.join(" "),disposable:l,free:m,role:s};return i&&(p.reason=i[0]),r&&(p.suggestion=r),p}function ee(e,o={}){return k(e,{...o,suggest:!1}).valid}function oe(e,o={}){if(typeof e!="string")return;let a=e.trim(),t=a.lastIndexOf("@");if(t<=0||a.length>Q)return;let n=a.slice(0,t),i=a.slice(t+1);if(S(`${n}@example.com`,F).fail)return;let l=J(n,i,F,o.domains);return l&&l.toLowerCase()!==a.toLowerCase()?l:void 0}function ae(e,o={}){if(typeof e!="string")throw new TypeError(`normalize() expects a string, got ${e===null?"null":typeof e}`);let a=e.trim();I.test(a)&&(a=a.normalize("NFC"));let t=a.lastIndexOf("@");if(t<0)return o.lowercase===!1?a:a.toLowerCase();let n=a.slice(0,t),i=a.slice(t+1).toLowerCase();if(n[0]!=='"'){if(o.plusTags!==!1){let l=n.indexOf("+");l>0&&(n=n.slice(0,l))}o.gmailDots!==!1&&(i==="gmail.com"||i==="googlemail.com")&&(i="gmail.com",n=n.split(".").join("")),o.lowercase!==!1&&(n=n.toLowerCase())}return`${n}@${i}`}function te(e){return typeof e=="string"&&h(H(e),B)}function ie(e){return typeof e=="string"&&E.has(H(e))}function ne(e){if(typeof e!="string")return!1;let o=e.trim(),a=o.lastIndexOf("@"),t=a<0?o:o.slice(0,a),n=t.indexOf("+");return n>=0&&(t=t.slice(0,n)),W.has(t.toLowerCase().replace(/[._-]/g,""))}var le=((e,o)=>k(e,o));Object.assign(le,{validate:k,isEmail:ee,suggest:oe,normalize:ae,isDisposable:te,isFreeProvider:ie,isRole:ne});var Se=le;0&&(module.exports={disposableDomains,freeProviders,isDisposable,isEmail,isFreeProvider,isRole,normalize,popularDomains,roleAccounts,suggest,validate});
2
+ var __d=module.exports.default;for(var __k in module.exports)if(!(__k in __d))__d[__k]=module.exports[__k];__d.default=__d;module.exports=__d;
@@ -0,0 +1,156 @@
1
+ /**
2
+ * inboxok — email validation for forms. Syntax, disposable domains and typo suggestions,
3
+ * synchronous and with no DNS, so it runs the same in browsers, edge runtimes and Node.
4
+ *
5
+ * inboxok('ana@gmial.com') // { valid: true, suggestion: 'ana@gmail.com', message: 'Did you mean ana@gmail.com?', ... }
6
+ * inboxok('ana@mailinator.com').reason // 'disposable'
7
+ * isEmail('ana@example.com') // true
8
+ */
9
+ /**
10
+ * Why an address was rejected.
11
+ *
12
+ * - `'empty'`: nothing entered (also `null` / `undefined`).
13
+ * - `'syntax'`: the address is malformed: no `@`, spaces, bad characters, misplaced dots...
14
+ * - `'too_long'`: over 64 bytes before the `@`, 254 in total, or a domain label over 63.
15
+ * - `'domain'`: the part after the `@` is not a valid domain name.
16
+ * - `'tld'`: the domain has no ending (`ana@gmail`) or an invalid one (`ana@example.c0m`).
17
+ * - `'ip'`: an IP address instead of a domain, and `allowIp` is off.
18
+ * - `'unicode'`: a non-ASCII character, and `allowUnicode` is off.
19
+ * - `'disposable'`: a throwaway inbox provider (with `blockDisposable`, on by default).
20
+ * - `'blocked'`: the domain is in `blockDomains`.
21
+ * - `'free'`: a free consumer provider such as Gmail (with `blockFree`).
22
+ * - `'role'`: a shared mailbox such as `admin@` or `noreply@` (with `blockRole`).
23
+ */
24
+ type Reason = 'empty' | 'syntax' | 'too_long' | 'domain' | 'tld' | 'ip' | 'unicode' | 'disposable' | 'blocked' | 'free' | 'role';
25
+ /** Keys of the `messages` option: every `Reason`, plus `'suggestion'` for the *Did you mean...?* text. */
26
+ type MessageKey = Reason | 'suggestion';
27
+ interface ValidateOptions {
28
+ /** Accept non-ASCII letters (`josé@exämple.de`, `用户@例子.中国`). Default `true`. */
29
+ allowUnicode?: boolean;
30
+ /** Accept quoted local parts (`"john doe"@example.com`). Default `false`. */
31
+ allowQuoted?: boolean;
32
+ /** Accept IP addresses instead of a domain (`ana@[192.168.0.1]`, `ana@[IPv6:::1]`). Default `false`. */
33
+ allowIp?: boolean;
34
+ /** Require a dot and a valid ending in the domain. Set `false` to accept `ana@localhost`. Default `true`. */
35
+ requireTld?: boolean;
36
+ /** Reject throwaway inbox providers (Mailinator, 10 Minute Mail, Guerrilla Mail...). Default `true`. */
37
+ blockDisposable?: boolean;
38
+ /** Reject free consumer providers (Gmail, Outlook, Yahoo...): for "use your work email" forms. Default `false`. */
39
+ blockFree?: boolean;
40
+ /** Reject shared role mailboxes (`admin@`, `noreply@`, `support@`...). Default `false`. */
41
+ blockRole?: boolean;
42
+ /** Extra domains to reject with reason `'blocked'`. Subdomains match too. */
43
+ blockDomains?: readonly string[];
44
+ /** Domains that are never flagged as disposable, blocked or free, and never get a typo suggestion. Subdomains match too. */
45
+ allowDomains?: readonly string[];
46
+ /** Suggest corrections for misspelled domains (`gmial.com` → `gmail.com`). Default `true`. */
47
+ suggest?: boolean;
48
+ /** Extra domains for typo suggestions, checked before the built-in list (e.g. your company's domain). */
49
+ domains?: readonly string[];
50
+ /**
51
+ * Replace the built-in English messages. Placeholders: `{email}`, `{local}`, `{domain}`, `{suggestion}`.
52
+ * Setting a reason replaces every message for that reason (the built-in ones are more specific,
53
+ * e.g. *Email address is missing an @.* for `'syntax'`).
54
+ */
55
+ messages?: Partial<Record<MessageKey, string>>;
56
+ }
57
+ interface ResultBase {
58
+ /** The address, trimmed, with the domain lowercased (and Unicode in NFC form). The local part keeps its case. */
59
+ email: string;
60
+ /** The part before the `@` (`''` if there is none). */
61
+ local: string;
62
+ /** The lowercased part after the `@` (`''` if there is none). */
63
+ domain: string;
64
+ /** A message to show the user. `''` for a valid address without a suggestion. */
65
+ message: string;
66
+ /** The corrected address when the domain looks misspelled: `'ana@gmail.com'` for `'ana@gmial.com'`. */
67
+ suggestion?: string;
68
+ /** The domain is a known throwaway inbox provider (even when `blockDisposable` is off). */
69
+ disposable: boolean;
70
+ /** The domain is a free consumer provider such as Gmail (even when `blockFree` is off). */
71
+ free: boolean;
72
+ /** The local part is a shared role mailbox such as `admin` (even when `blockRole` is off). */
73
+ role: boolean;
74
+ }
75
+ interface ValidResult extends ResultBase {
76
+ valid: true;
77
+ reason?: undefined;
78
+ }
79
+ interface InvalidResult extends ResultBase {
80
+ valid: false;
81
+ reason: Reason;
82
+ }
83
+ type ValidationResult = ValidResult | InvalidResult;
84
+ interface NormalizeOptions {
85
+ /** Lowercase the local part too. Almost every provider ignores case. Default `true`. */
86
+ lowercase?: boolean;
87
+ /** Remove `+tags`: `ana+news@example.com` → `ana@example.com`. Default `true`. */
88
+ plusTags?: boolean;
89
+ /** Gmail ignores dots: `a.n.a@gmail.com` → `ana@gmail.com`, and `googlemail.com` → `gmail.com`. Default `true`. */
90
+ gmailDots?: boolean;
91
+ }
92
+ interface SuggestOptions {
93
+ /** Extra domains to suggest, checked before the built-in list. */
94
+ domains?: readonly string[];
95
+ }
96
+ /** The built-in list of disposable (throwaway) inbox domains. Subdomains of these match too. */
97
+ declare const disposableDomains: readonly string[];
98
+ /** The built-in list of free consumer email providers and ISPs. */
99
+ declare const freeProviders: readonly string[];
100
+ /** The built-in domains used for typo suggestions, most popular first. */
101
+ declare const popularDomains: readonly string[];
102
+ /** The built-in role mailbox names, without `.`, `-` and `_` (`no-reply` is matched as `noreply`). */
103
+ declare const roleAccounts: readonly string[];
104
+ /**
105
+ * Validates an email address and explains the problem, if any.
106
+ *
107
+ * validate('ana@example.com') // { valid: true, email: 'ana@example.com', message: '', ... }
108
+ * validate('ana@gmial.com') // { valid: true, suggestion: 'ana@gmail.com', message: 'Did you mean ana@gmail.com?', ... }
109
+ * validate('ana@mailinator.com') // { valid: false, reason: 'disposable', message: 'Disposable email addresses are not allowed.', ... }
110
+ * validate('ana@@example.com') // { valid: false, reason: 'syntax', message: 'Email address can only have one @.', ... }
111
+ *
112
+ * Never throws. `null`, `undefined` and `''` give reason `'empty'`; other non-strings give `'syntax'`.
113
+ */
114
+ declare function validate(email: unknown, options?: ValidateOptions): ValidationResult;
115
+ /**
116
+ * `true` if `validate(email, options)` accepts the address. With the default options this means valid
117
+ * syntax and not a disposable domain; pass `{ blockDisposable: false }` for a syntax-only check.
118
+ */
119
+ declare function isEmail(email: unknown, options?: ValidateOptions): boolean;
120
+ /**
121
+ * Suggests a correction for a misspelled domain, or returns `undefined`.
122
+ *
123
+ * suggest('ana@gmial.com') // 'ana@gmail.com'
124
+ * suggest('ana@gmail,com') // 'ana@gmail.com'
125
+ * suggest('ana@acme.con') // 'ana@acme.com'
126
+ * suggest('ana@gmail.com') // undefined
127
+ */
128
+ declare function suggest(email: string, options?: SuggestOptions): string | undefined;
129
+ /**
130
+ * Normalizes an address for duplicate detection: trims, lowercases, removes `+tags` and Gmail dots.
131
+ * It does not validate; check with `validate` first.
132
+ *
133
+ * normalize(' Ana.Silva+news@GoogleMail.com ') // 'anasilva@gmail.com'
134
+ * normalize('Ana+news@Example.com', { lowercase: false, plusTags: false }) // 'Ana+news@example.com'
135
+ */
136
+ declare function normalize(email: string, options?: NormalizeOptions): string;
137
+ /** `true` if the address (or bare domain) is on the built-in disposable list. Subdomains match. */
138
+ declare function isDisposable(emailOrDomain: string): boolean;
139
+ /** `true` if the address (or bare domain) belongs to a free consumer provider such as Gmail or Outlook. */
140
+ declare function isFreeProvider(emailOrDomain: string): boolean;
141
+ /** `true` if the address (or bare local part) is a shared role mailbox such as `admin`, `noreply` or `support`. */
142
+ declare function isRole(emailOrLocal: string): boolean;
143
+ interface Inboxok {
144
+ /** Validates an email address. Same as `validate`. */
145
+ (email: unknown, options?: ValidateOptions): ValidationResult;
146
+ validate: typeof validate;
147
+ isEmail: typeof isEmail;
148
+ suggest: typeof suggest;
149
+ normalize: typeof normalize;
150
+ isDisposable: typeof isDisposable;
151
+ isFreeProvider: typeof isFreeProvider;
152
+ isRole: typeof isRole;
153
+ }
154
+ declare const inboxok: Inboxok;
155
+
156
+ export { type Inboxok, type InvalidResult, type MessageKey, type NormalizeOptions, type Reason, type SuggestOptions, type ValidResult, type ValidateOptions, type ValidationResult, inboxok as default, disposableDomains, freeProviders, isDisposable, isEmail, isFreeProvider, isRole, normalize, popularDomains, roleAccounts, suggest, validate };
@@ -0,0 +1,156 @@
1
+ /**
2
+ * inboxok — email validation for forms. Syntax, disposable domains and typo suggestions,
3
+ * synchronous and with no DNS, so it runs the same in browsers, edge runtimes and Node.
4
+ *
5
+ * inboxok('ana@gmial.com') // { valid: true, suggestion: 'ana@gmail.com', message: 'Did you mean ana@gmail.com?', ... }
6
+ * inboxok('ana@mailinator.com').reason // 'disposable'
7
+ * isEmail('ana@example.com') // true
8
+ */
9
+ /**
10
+ * Why an address was rejected.
11
+ *
12
+ * - `'empty'`: nothing entered (also `null` / `undefined`).
13
+ * - `'syntax'`: the address is malformed: no `@`, spaces, bad characters, misplaced dots...
14
+ * - `'too_long'`: over 64 bytes before the `@`, 254 in total, or a domain label over 63.
15
+ * - `'domain'`: the part after the `@` is not a valid domain name.
16
+ * - `'tld'`: the domain has no ending (`ana@gmail`) or an invalid one (`ana@example.c0m`).
17
+ * - `'ip'`: an IP address instead of a domain, and `allowIp` is off.
18
+ * - `'unicode'`: a non-ASCII character, and `allowUnicode` is off.
19
+ * - `'disposable'`: a throwaway inbox provider (with `blockDisposable`, on by default).
20
+ * - `'blocked'`: the domain is in `blockDomains`.
21
+ * - `'free'`: a free consumer provider such as Gmail (with `blockFree`).
22
+ * - `'role'`: a shared mailbox such as `admin@` or `noreply@` (with `blockRole`).
23
+ */
24
+ type Reason = 'empty' | 'syntax' | 'too_long' | 'domain' | 'tld' | 'ip' | 'unicode' | 'disposable' | 'blocked' | 'free' | 'role';
25
+ /** Keys of the `messages` option: every `Reason`, plus `'suggestion'` for the *Did you mean...?* text. */
26
+ type MessageKey = Reason | 'suggestion';
27
+ interface ValidateOptions {
28
+ /** Accept non-ASCII letters (`josé@exämple.de`, `用户@例子.中国`). Default `true`. */
29
+ allowUnicode?: boolean;
30
+ /** Accept quoted local parts (`"john doe"@example.com`). Default `false`. */
31
+ allowQuoted?: boolean;
32
+ /** Accept IP addresses instead of a domain (`ana@[192.168.0.1]`, `ana@[IPv6:::1]`). Default `false`. */
33
+ allowIp?: boolean;
34
+ /** Require a dot and a valid ending in the domain. Set `false` to accept `ana@localhost`. Default `true`. */
35
+ requireTld?: boolean;
36
+ /** Reject throwaway inbox providers (Mailinator, 10 Minute Mail, Guerrilla Mail...). Default `true`. */
37
+ blockDisposable?: boolean;
38
+ /** Reject free consumer providers (Gmail, Outlook, Yahoo...): for "use your work email" forms. Default `false`. */
39
+ blockFree?: boolean;
40
+ /** Reject shared role mailboxes (`admin@`, `noreply@`, `support@`...). Default `false`. */
41
+ blockRole?: boolean;
42
+ /** Extra domains to reject with reason `'blocked'`. Subdomains match too. */
43
+ blockDomains?: readonly string[];
44
+ /** Domains that are never flagged as disposable, blocked or free, and never get a typo suggestion. Subdomains match too. */
45
+ allowDomains?: readonly string[];
46
+ /** Suggest corrections for misspelled domains (`gmial.com` → `gmail.com`). Default `true`. */
47
+ suggest?: boolean;
48
+ /** Extra domains for typo suggestions, checked before the built-in list (e.g. your company's domain). */
49
+ domains?: readonly string[];
50
+ /**
51
+ * Replace the built-in English messages. Placeholders: `{email}`, `{local}`, `{domain}`, `{suggestion}`.
52
+ * Setting a reason replaces every message for that reason (the built-in ones are more specific,
53
+ * e.g. *Email address is missing an @.* for `'syntax'`).
54
+ */
55
+ messages?: Partial<Record<MessageKey, string>>;
56
+ }
57
+ interface ResultBase {
58
+ /** The address, trimmed, with the domain lowercased (and Unicode in NFC form). The local part keeps its case. */
59
+ email: string;
60
+ /** The part before the `@` (`''` if there is none). */
61
+ local: string;
62
+ /** The lowercased part after the `@` (`''` if there is none). */
63
+ domain: string;
64
+ /** A message to show the user. `''` for a valid address without a suggestion. */
65
+ message: string;
66
+ /** The corrected address when the domain looks misspelled: `'ana@gmail.com'` for `'ana@gmial.com'`. */
67
+ suggestion?: string;
68
+ /** The domain is a known throwaway inbox provider (even when `blockDisposable` is off). */
69
+ disposable: boolean;
70
+ /** The domain is a free consumer provider such as Gmail (even when `blockFree` is off). */
71
+ free: boolean;
72
+ /** The local part is a shared role mailbox such as `admin` (even when `blockRole` is off). */
73
+ role: boolean;
74
+ }
75
+ interface ValidResult extends ResultBase {
76
+ valid: true;
77
+ reason?: undefined;
78
+ }
79
+ interface InvalidResult extends ResultBase {
80
+ valid: false;
81
+ reason: Reason;
82
+ }
83
+ type ValidationResult = ValidResult | InvalidResult;
84
+ interface NormalizeOptions {
85
+ /** Lowercase the local part too. Almost every provider ignores case. Default `true`. */
86
+ lowercase?: boolean;
87
+ /** Remove `+tags`: `ana+news@example.com` → `ana@example.com`. Default `true`. */
88
+ plusTags?: boolean;
89
+ /** Gmail ignores dots: `a.n.a@gmail.com` → `ana@gmail.com`, and `googlemail.com` → `gmail.com`. Default `true`. */
90
+ gmailDots?: boolean;
91
+ }
92
+ interface SuggestOptions {
93
+ /** Extra domains to suggest, checked before the built-in list. */
94
+ domains?: readonly string[];
95
+ }
96
+ /** The built-in list of disposable (throwaway) inbox domains. Subdomains of these match too. */
97
+ declare const disposableDomains: readonly string[];
98
+ /** The built-in list of free consumer email providers and ISPs. */
99
+ declare const freeProviders: readonly string[];
100
+ /** The built-in domains used for typo suggestions, most popular first. */
101
+ declare const popularDomains: readonly string[];
102
+ /** The built-in role mailbox names, without `.`, `-` and `_` (`no-reply` is matched as `noreply`). */
103
+ declare const roleAccounts: readonly string[];
104
+ /**
105
+ * Validates an email address and explains the problem, if any.
106
+ *
107
+ * validate('ana@example.com') // { valid: true, email: 'ana@example.com', message: '', ... }
108
+ * validate('ana@gmial.com') // { valid: true, suggestion: 'ana@gmail.com', message: 'Did you mean ana@gmail.com?', ... }
109
+ * validate('ana@mailinator.com') // { valid: false, reason: 'disposable', message: 'Disposable email addresses are not allowed.', ... }
110
+ * validate('ana@@example.com') // { valid: false, reason: 'syntax', message: 'Email address can only have one @.', ... }
111
+ *
112
+ * Never throws. `null`, `undefined` and `''` give reason `'empty'`; other non-strings give `'syntax'`.
113
+ */
114
+ declare function validate(email: unknown, options?: ValidateOptions): ValidationResult;
115
+ /**
116
+ * `true` if `validate(email, options)` accepts the address. With the default options this means valid
117
+ * syntax and not a disposable domain; pass `{ blockDisposable: false }` for a syntax-only check.
118
+ */
119
+ declare function isEmail(email: unknown, options?: ValidateOptions): boolean;
120
+ /**
121
+ * Suggests a correction for a misspelled domain, or returns `undefined`.
122
+ *
123
+ * suggest('ana@gmial.com') // 'ana@gmail.com'
124
+ * suggest('ana@gmail,com') // 'ana@gmail.com'
125
+ * suggest('ana@acme.con') // 'ana@acme.com'
126
+ * suggest('ana@gmail.com') // undefined
127
+ */
128
+ declare function suggest(email: string, options?: SuggestOptions): string | undefined;
129
+ /**
130
+ * Normalizes an address for duplicate detection: trims, lowercases, removes `+tags` and Gmail dots.
131
+ * It does not validate; check with `validate` first.
132
+ *
133
+ * normalize(' Ana.Silva+news@GoogleMail.com ') // 'anasilva@gmail.com'
134
+ * normalize('Ana+news@Example.com', { lowercase: false, plusTags: false }) // 'Ana+news@example.com'
135
+ */
136
+ declare function normalize(email: string, options?: NormalizeOptions): string;
137
+ /** `true` if the address (or bare domain) is on the built-in disposable list. Subdomains match. */
138
+ declare function isDisposable(emailOrDomain: string): boolean;
139
+ /** `true` if the address (or bare domain) belongs to a free consumer provider such as Gmail or Outlook. */
140
+ declare function isFreeProvider(emailOrDomain: string): boolean;
141
+ /** `true` if the address (or bare local part) is a shared role mailbox such as `admin`, `noreply` or `support`. */
142
+ declare function isRole(emailOrLocal: string): boolean;
143
+ interface Inboxok {
144
+ /** Validates an email address. Same as `validate`. */
145
+ (email: unknown, options?: ValidateOptions): ValidationResult;
146
+ validate: typeof validate;
147
+ isEmail: typeof isEmail;
148
+ suggest: typeof suggest;
149
+ normalize: typeof normalize;
150
+ isDisposable: typeof isDisposable;
151
+ isFreeProvider: typeof isFreeProvider;
152
+ isRole: typeof isRole;
153
+ }
154
+ declare const inboxok: Inboxok;
155
+
156
+ export { type Inboxok, type InvalidResult, type MessageKey, type NormalizeOptions, type Reason, type SuggestOptions, type ValidResult, type ValidateOptions, type ValidationResult, inboxok as default, disposableDomains, freeProviders, isDisposable, isEmail, isFreeProvider, isRole, normalize, popularDomains, roleAccounts, suggest, validate };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ var S="0-mail.com 0815.ru 0815.su 0clickemail.com 0wnd.net 0wnd.org 10mail.org 10minemail.com 10minutemail.be 10minutemail.cf 10minutemail.co.uk 10minutemail.com 10minutemail.de 10minutemail.net 10minutesmail.com 1pad.de 1secmail.com 1secmail.net 1secmail.org 20email.eu 20minutemail.com 20minutemail.it 30minutemail.com 4warding.com 4warding.net 4warding.org 60minutemail.com amilegit.com anonbox.net anonymbox.com antispam.de armyspy.com bccto.me binkmail.com bobmail.info brefmail.com bumpymail.com byom.de chacuo.net chammy.info cheatmail.de courriel.fr.nf courrieltemporaire.com crazymailing.com cuvox.de dayrep.com deadaddress.com deadspam.com despam.it despammed.com devnullmail.com discard.email discardmail.com discardmail.de dispomail.eu disposableaddress.com disposableemailaddresses.com disposableinbox.com disposeamail.com disposemail.com dispostable.com dodgeit.com dodgit.com dontreg.com dontsendmespam.de drdrb.net dropmail.me dump-email.info dumpandjunk.com dumpmail.de dumpyemail.com easytrashmail.com einrot.com einrot.de emailfake.com emailgenerator.de emailinfive.com emailmiser.com emailnax.com emailondeck.com emailsensei.com emailtemporanea.com emailtemporanea.net emailtemporar.ro emailtemporario.com.br emailtmp.com emailwarden.com emailxfer.com emlhub.com emlpro.com emltmp.com ephemail.net esiix.com etranquil.com etranquil.net etranquil.org explodemail.com fakeinbox.com fakeinformation.com fakemail.fr fakemail.net fakemailgenerator.com fexbox.org fexpost.com fextemp.com filzmail.com fizmail.com fleckens.hu fr33mail.info frapmail.com friendlymail.co.uk get1mail.com get2mail.fr getairmail.com getnada.cc getnada.com getonemail.com getonemail.net grr.la gsrv.co.uk guerillamail.biz guerillamail.com guerillamail.de guerillamail.info guerillamail.net guerillamail.org guerrillamail.biz guerrillamail.com guerrillamail.de guerrillamail.info guerrillamail.net guerrillamail.org guerrillamailblock.com gustr.com haltospam.com harakirimail.com hatespam.org hidemail.de hmamail.com hulapla.de ieatspam.eu ieatspam.info imails.info inboxalias.com inboxbear.com inboxclean.com inboxclean.org inboxkitten.com incognitomail.com incognitomail.net incognitomail.org instant-mail.de jetable.com jetable.fr.nf jetable.net jetable.org jourrapide.com kasmail.com killmail.com killmail.net koszmail.pl kurzepost.de letthemeatspam.com linshiyouxiang.net litedrop.com lookugly.com lortemail.dk m4ilweb.info mail-temp.com mail-temporaire.fr mail4trash.com mail7.io mailbidon.com mailbox.in.ua mailcatch.com maildrop.cc maileater.com mailexpire.com mailfa.tk mailforspam.com mailfreeonline.com mailguard.me mailhazard.com mailhazard.us mailhz.me mailimate.com mailin8r.com mailinater.com mailinator.com mailinator.net mailinator.org mailinator.us mailinator2.com mailincubator.com mailismagic.com mailme24.com mailmetrash.com mailnator.com mailnesia.com mailnull.com mailpoof.com mailquack.com mailrock.biz mailsac.com mailscrap.com mailsiphon.com mailslapping.com mailslite.com mailtemp.info mailtothis.com mailzilla.com mailzilla.org mega.zik.dj meltmail.com mintemail.com minuteinbox.com moakt.cc moakt.com moakt.ws mohmal.com moncourrier.fr.nf monemail.fr.nf monmail.fr.nf monumentmail.com mt2015.com mvrht.com mvrht.net mycleaninbox.net myphantomemail.com mytemp.email mytempemail.com mytempmail.com mytrashmail.com nada.email no-spam.ws noclickemail.com nogmailspam.info nomail.xl.cx nomail2me.com nomorespamemails.com nospam.ze.tc nospam4.us nospamfor.us nospamthanks.info notmailinator.com nowmymail.com nurfuerspam.de objectmail.com oneoffemail.com onewaymail.com owlpic.com pancakemail.com pokemail.net pookmail.com proxymail.eu putthisinyourspamdatabase.com quickinbox.com rcpt.at reallymymail.com receiveee.com rejectmail.com rhyta.com rmqkr.net rppkn.com safetymail.info selfdestructingmail.com sendspamhere.com sharklasers.com shitmail.me shortmail.net skeefmail.com slaskpost.se slopsbox.com smailpro.com smashmail.de smellfear.com snakemail.com sofimail.com sogetthis.com spam.la spam.su spam4.me spamavert.com spambob.com spambob.net spambob.org spambog.com spambog.de spambog.ru spambox.info spambox.me spambox.us spamcero.com spamcorptastic.com spamcowboy.com spamcowboy.net spamcowboy.org spamday.com spamdecoy.net spamfree.eu spamfree24.com spamfree24.de spamfree24.eu spamfree24.info spamfree24.net spamfree24.org spamherelots.com spamhereplease.com spamhole.com spamify.com spamkill.info spaml.com spaml.de spamobox.com spamspot.com spamstack.net spamthis.co.uk spamthisplease.com spamtrail.com speed.1s.fr streetwisemail.com supergreatmail.com supermailer.jp superrito.com suremail.info tagyourself.com teleworm.com teleworm.us temp-mail.com temp-mail.de temp-mail.org temp-mail.ru temp-mails.com tempail.com tempalias.com tempemail.biz tempemail.com tempemail.net tempinbox.co.uk tempinbox.com tempm.com tempmail.de tempmail.dev tempmail.email tempmail.io tempmail.it tempmail.ninja tempmail.plus tempmail.us tempmail2.com tempmailer.com tempmailer.de tempmailin.com tempmailo.com tempmails.net tempomail.fr temporarily.de temporarioemail.com.br temporaryemail.net temporaryemail.us temporaryforwarding.com temporaryinbox.com temporarymailaddress.com tempr.email tempsky.com thanksnospam.info thankyou2010.com thisisnotmyrealemail.com throwam.com throwawayemailaddress.com throwawaymail.com tmail.ws tmailinator.com tmails.net tmpeml.com tmpmail.net tmpmail.org tradermail.info trash-amil.com trash-mail.at trash-mail.com trash-mail.de trash-me.com trash2009.com trashdevil.com trashdevil.de trashemail.de trashinbox.com trashmail.at trashmail.com trashmail.de trashmail.io trashmail.me trashmail.net trashmail.org trashmail.ws trashmailer.com trashymail.com trashymail.net twinmail.de venompen.com veryrealemail.com viditag.com webm4il.info wegwerfadresse.de wegwerfemail.de wegwerfmail.de wegwerfmail.net wegwerfmail.org whyspam.me wilemail.com willselfdestruct.com wuzup.net wuzupmail.net wwjmp.com wwwnew.eu xmaily.com xojxe.com yoggm.com yopmail.com yopmail.fr yopmail.gq yopmail.net zehnminuten.de zehnminutenmail.de zetmail.com zippymail.info",T="126.com 139.com 163.com 189.cn abv.bg aim.com aliceadsl.fr alice.it aliyun.com aol.com aol.co.uk aol.de aol.fr aol.it arcor.de atlas.cz att.net azet.sk bbox.fr bellsouth.net bigmir.net bigpond.com bigpond.net.au bk.ru bluewin.ch blueyonder.co.uk bol.com.br btinternet.com centrum.cz centurylink.net charter.net citromail.hu club-internet.fr comcast.net consultant.com cox.net daum.net dir.bg disroot.org dr.com earthlink.net email.com email.cz email.it engineer.com fastmail.com fastmail.fm foxmail.com free.fr freemail.hu freenet.de frontier.com games.com gazeta.pl globo.com globomail.com gmail.com gmx.at gmx.ch gmx.com gmx.co.uk gmx.de gmx.es gmx.fr gmx.it gmx.net gmx.us googlemail.com hanmail.net hetnet.nl hey.com hispeed.ch home.nl hotmail.at hotmail.be hotmail.ca hotmail.ch hotmail.co.in hotmail.co.jp hotmail.com hotmail.com.ar hotmail.com.au hotmail.com.br hotmail.com.mx hotmail.co.uk hotmail.de hotmail.dk hotmail.es hotmail.fi hotmail.fr hotmail.gr hotmail.it hotmail.nl hotmail.no hotmail.se hushmail.com icloud.com ig.com.br inbox.com inbox.lv inbox.ru interia.pl internet.ru i.ua juno.com kakao.com kpnmail.nl laposte.net libero.it list.ru live.at live.be live.ca live.cl live.cn live.com live.com.ar live.com.au live.com.mx live.co.uk live.co.za live.de live.dk live.fr live.ie live.in live.it live.jp live.nl live.no live.se love.com mac.com mail.bg mailbox.org mail.com mailfence.com mail.ru me.com meta.ua msn.com myself.com nate.com naver.com netzero.net neuf.fr ntlworld.com o2.pl onet.pl op.pl optonline.net optusnet.com.au orange.fr outlook.at outlook.be outlook.cl outlook.co.id outlook.com outlook.com.ar outlook.com.au outlook.com.br outlook.com.mx outlook.co.nz outlook.co.th outlook.co.uk outlook.de outlook.dk outlook.es outlook.fr outlook.ie outlook.in outlook.it outlook.jp outlook.sa passport.com planet.nl pm.me post.com post.cz posteo.de posteo.net protonmail.ch protonmail.com proton.me qq.com rambler.ru rediffmail.com riseup.net roadrunner.com rocketmail.com rogers.com runbox.com sapo.pt sbcglobal.net seznam.cz sfr.fr shaw.ca sina.cn sina.com sky.com skynet.be sohu.com startmail.com sympatico.ca talktalk.net techie.com telenet.be telus.net terra.com.br tin.it tiscali.co.uk tiscali.it tlen.pl t-online.de tuta.com tuta.io tutamail.com tutanota.com tutanota.de twc.com ukr.net uol.com.br usa.com verizon.net videotron.ca vip.163.com vip.qq.com virgilio.it virginmedia.com walla.co.il walla.com wanadoo.fr web.de windowslive.com windstream.net wow.com wp.pl writeme.com xtra.co.nz yahoo.at yahoo.be yahoo.ca yahoo.co.id yahoo.co.in yahoo.co.jp yahoo.com yahoo.com.ar yahoo.com.au yahoo.com.br yahoo.com.hk yahoo.com.mx yahoo.com.ph yahoo.com.sg yahoo.com.tw yahoo.com.vn yahoo.co.nz yahoo.co.th yahoo.co.uk yahoo.co.za yahoo.de yahoo.dk yahoo.es yahoo.fr yahoo.gr yahoo.ie yahoo.in yahoo.it yahoo.nl yahoo.no yahoo.pl yahoo.se yandex.by yandex.com yandex.com.tr yandex.kz yandex.ru yandex.ua ya.ru yeah.net ygm.com ymail.com ziggo.nl zoho.com zohomail.com zohomail.eu",j="gmail.com yahoo.com hotmail.com outlook.com icloud.com aol.com live.com msn.com me.com mac.com googlemail.com ymail.com rocketmail.com protonmail.com proton.me comcast.net verizon.net att.net sbcglobal.net bellsouth.net charter.net earthlink.net optonline.net cox.net yahoo.co.uk hotmail.co.uk outlook.co.uk live.co.uk btinternet.com yahoo.co.in rediffmail.com yahoo.ca hotmail.ca yahoo.fr hotmail.fr outlook.fr live.fr orange.fr wanadoo.fr laposte.net yahoo.de hotmail.de outlook.de gmx.de gmx.net web.de t-online.de yahoo.es hotmail.es outlook.es yahoo.it hotmail.it libero.it yahoo.com.br hotmail.com.br uol.com.br bol.com.br yahoo.com.au bigpond.com yahoo.co.jp mail.ru yandex.ru qq.com 163.com fastmail.com tutanota.com zoho.com mail.com gmx.com",L="abuse admin administrator hostmaster postmaster webmaster webadmin root sysadmin noreply donotreply nobody mailerdaemon bounce bounces support help helpdesk techsupport info information contact contactus hello sales marketing billing accounts accounting finance invoices payments office team staff all everyone hr jobs careers recruiting recruitment security privacy legal compliance press media pr news newsletter notifications alerts feedback enquiries enquiry inquiries inquiry service services customerservice customercare customersupport care orders shop store booking bookings reservations admissions it tech dev devops ops operations mail email www ftp list listserv majordomo subscribe unsubscribe investors ir partners partnerships affiliates social community events membership members",P={con:"com",cpm:"com",cmo:"com",ocm:"com",vom:"com",xom:"com",comm:"com",coom:"com",cim:"com",c0m:"com",conm:"com",comn:"com",clm:"com",cok:"com",cpom:"com",comj:"com",ckm:"com",coim:"com",nte:"net",ner:"net",nett:"net",nwt:"net",ney:"net",nrt:"net",ogr:"org",rog:"org",orgg:"org",prg:"org"};var x=e=>Object.freeze(e.split(" ")),Y=x(S),G=x(T),Z=x(j),J=x(L),M=new Set(Y),z=new Set(G),U=new Set(J),ee=new Map(Object.entries(P)),$=1024,oe="!#$%&'*+-/=?^_`{|}~",V=/\s|\p{Z}/u,O=/\p{C}/u,ae=/[\p{L}\p{M}\p{N}]/u,te=/^[\p{L}\p{M}]+$/u,E=/[^\x00-\x7f]/,q=/^[0-9a-f]{1,4}$/i,ie=/\{(email|local|domain|suggestion|char)\}/g,N=e=>e>=48&&e<=57||e>=97&&e<=122||e>=65&&e<=90,ne=e=>{let o=0;for(let a of e){let t=a.codePointAt(0);o+=t<128?1:t<2048?2:t<65536?3:4}return o},B=e=>{let o=e.lastIndexOf("@");return(o<0?e:e.slice(o+1)).trim().toLowerCase()},W=e=>{let o=String(e).trim().toLowerCase();return o.startsWith("@")&&(o=o.slice(1)),o.startsWith("*.")&&(o=o.slice(2)),o.startsWith(".")&&(o=o.slice(1)),o},C=new WeakMap,w=e=>{if(!e||e.length===0)return;let o=C.get(e);return o||C.set(e,o=new Set(e.map(W))),o},h=(e,o)=>{if(!o||e.length>253)return!1;for(let a=e;;){if(o.has(a))return!0;let t=a.indexOf(".");if(t<0)return!1;a=a.slice(t+1)}},v=e=>{let o=e.split(".");return o.length===4&&o.every(a=>a.length>0&&a.length<=3&&/^\d+$/.test(a)&&(a==="0"||a[0]!=="0")&&+a<=255)},le=e=>{if(e.length<2||e.length>45)return!1;if(e.includes(".")){let i=e.lastIndexOf(":");if(i<0||!v(e.slice(i+1)))return!1;e=e.slice(0,i+1)+"0:0"}let o=e.indexOf("::");if(o<0){let i=e.split(":");return i.length===8&&i.every(l=>q.test(l))}if(e.indexOf("::",o+1)>=0)return!1;let a=e.slice(0,o),t=e.slice(o+2),n=[...a?a.split(":"):[],...t?t.split(":"):[]];return n.length<=7&&n.every(i=>q.test(i))},me=e=>{let o=Array.from(e,m=>m.codePointAt(0)),a=0;for(let m of o)m<128&&a++;let t=a;t&&a++;let n=128,i=0,l=72;for(let m=t;m<o.length;){let s=1/0;for(let r of o)r>=n&&r<s&&(s=r);i+=(s-n)*(m+1),n=s;for(let r of o)if(r<n&&i++,r===n){let c=i;for(let p=36;;p+=36){let g=p<=l?1:p>=l+26?26:p-l;if(c<g)break;a++,c=Math.floor((c-g)/(36-g))}a++;let d=m===t?Math.floor(i/700):i>>1;d+=Math.floor(d/(m+1));let u=0;for(;d>455;u+=36)d=Math.floor(d/35);l=Math.floor(u+36*d/(d+38)),i=0,m++}i++,n++}return a+4},y=(e,o,a)=>{if(e===o)return 0;if(Math.abs(e.length-o.length)>a)return a+1;let t=[],n=Array.from({length:o.length+1},(i,l)=>l);for(let i=1;i<=e.length;i++){let l=[i],m=i;for(let s=1;s<=o.length;s++){let r=Math.min(n[s]+1,l[s-1]+1,n[s-1]+(e[i-1]===o[s-1]?0:1));i>1&&s>1&&e[i-1]===o[s-2]&&e[i-2]===o[s-1]&&(r=Math.min(r,t[s-2]+1)),l.push(r),r<m&&(m=r)}if(m>a)return a+1;t=n,n=l}return n[o.length]},f={empty:"Enter an email address.",syntax:"Enter a valid email address.",too_long:"This email address is too long.",domain:'The domain "{domain}" is not valid.',tld:'The domain "{domain}" needs an ending like .com.',ip:"Use a domain name, not an IP address.",unicode:`Email address can't contain "{char}".`,disposable:"Disposable email addresses are not allowed.",blocked:"Email addresses from {domain} are not allowed.",free:"Use your work email address.",role:"Use a personal email address, not a shared one like {local}@.",suggestion:"Did you mean {suggestion}?"},Q="Email address can't contain two dots in a row.",b=(e,o)=>e==="@"?["syntax","Email address can only have one @."]:V.test(e)?[o,"Email address can't contain spaces."]:O.test(e)?[o,"Email address contains an invisible or control character."]:[o,`Email address can't contain "{char}".`,e],K=(e,o,a,t)=>{if(V.test(e)||O.test(e)||t&&!ae.test(e))return b(e,o);if(!a)return["unicode",f.unicode,e]},se=(e,o)=>{if(e[0]==="."||e[e.length-1]===".")return["syntax","The part before the @ can't start or end with a dot."];let a=!1;for(let t of e){if(t==="."){if(a)return["syntax",Q];a=!0;continue}a=!1;let n=t.codePointAt(0);if(n<128){if(!N(n)&&!oe.includes(t))return b(t,"syntax")}else{let i=K(t,"syntax",o,!1);if(i)return i}}},re=(e,o)=>{let a=!1;for(let t of e){let n=t.codePointAt(0);if(n>=128){if(O.test(t))return b(t,"syntax");if(!o)return["unicode",f.unicode,t]}else{if(n<32||n===127)return b(t,"syntax");if(!a&&t==="\\"){a=!0;continue}}a=!1}},ce=(e,o)=>{if(!e)return{fail:["domain","Enter the domain after the @, like example.com."],length:0};if(e[0]==="["){if(e[e.length-1]!=="]")return{fail:["domain",f.domain],length:0};if(!o.allowIp)return{fail:["ip",f.ip],length:0};let l=e.slice(1,-1);return(l.startsWith("ipv6:")?le(l.slice(5)):v(l))?{ip:!0,length:e.length}:{fail:["domain","The IP address {domain} is not valid."],length:0}}if(e[0]==="."||e[e.length-1]===".")return{fail:["domain","The domain can't start or end with a dot."],length:0};let a=e.split("."),t=a.length-1;for(let l of a){if(!l)return{fail:["domain",Q],length:0};let m=!0;for(let r of l){let c=r.codePointAt(0);if(c<128){if(!N(c)&&r!=="-")return{fail:b(r,"domain"),length:0}}else{m=!1;let d=K(r,"domain",o.allowUnicode,!0);if(d)return{fail:d,length:0}}}if(l[0]==="-"||l[l.length-1]==="-")return{fail:["domain","Domain names can't start or end with a hyphen."],length:0};let s=m?l.length:me(l);if(s>63)return{fail:["too_long","The domain name is too long."],length:0};t+=s}if(t>253)return{fail:["too_long","The domain name is too long."],length:0};if(v(e))return o.allowIp?{ip:!0,length:t}:{fail:["ip",f.ip],length:0};let n=a[a.length-1];return a.length===1?o.requireTld?{fail:["tld",f.tld],length:0}:{length:t}:(E.test(n)?te.test(n)&&Array.from(n).length>=2:n.startsWith("xn--")?n.length>4:n.length>=2&&/^[a-z]+$/.test(n))?{length:t}:{fail:["tld",'The domain "{domain}" has an invalid ending.'],length:0}},R=(e,o)=>{let a=e.trim(),t={email:a,local:"",domain:"",quoted:!1,ip:!1,localOk:!1};if(!a)return{...t,fail:["empty",f.empty]};if(a.length>$)return{...t,fail:["too_long",f.too_long]};E.test(a)&&(a=t.email=a.normalize("NFC"));let n,i,l=a[0]==='"';if(l){let u=-1;for(let p=1;p<a.length;p++)if(a[p]==="\\")p++;else if(a[p]==='"'){u=p;break}if(n=u+1,u<0||a[n]!=="@")return{...t,fail:["syntax",u<0?f.syntax:"Email address can only have one @."]}}else if(n=a.lastIndexOf("@"),n<0)return{...t,fail:["syntax","Email address is missing an @."]};let m=a.slice(0,n),s=a.slice(n+1).toLowerCase(),r=s.startsWith("[ipv6:")?"[IPv6:"+s.slice(6):s;Object.assign(t,{local:m,domain:r,quoted:l,email:m+"@"+r}),!m||m==='""'?i=["syntax","Enter the part before the @."]:l?i=o.allowQuoted?re(m.slice(1,-1),o.allowUnicode):["syntax","Quoted email addresses are not allowed."]:i=se(m,o.allowUnicode);let c=ne(m);if(!i&&c>64&&(i=["too_long","The part before the @ is too long."]),i)return{...t,fail:i};t.localOk=!0;let d=ce(s,o);return d.fail?{...t,fail:d.fail}:(t.ip=!!d.ip,c+1+d.length>254?{...t,fail:["too_long",f.too_long]}:t)},D=e=>{let o=e.indexOf("."),a=o<0?e:e.slice(0,o);return{domain:e,sld:a,suffix:o<0?"":e.slice(o+1),flat:e.split(".").join(""),max:a.length<=4?0:a.length<=8?1:2}},k,_=new WeakMap,de=e=>{if(k??(k=Z.map(D)),!e||e.length===0)return k;let o=_.get(e);return o||_.set(e,o=[...e.map(a=>D(W(a))),...k]),o},fe=e=>e.toLowerCase().replace(/\s/g,"").replace(/,/g,".").split(".").filter(Boolean).join("."),ue=(e,o,a)=>{if(!e||a(e))return;let t=e.indexOf(".");if(t<0){for(let c of o)if(y(e,c.sld,c.max)<=c.max||y(e,c.flat,c.max)<=c.max)return c.domain;return}let n=e.slice(0,t),i=e.slice(t+1),l=i.lastIndexOf("."),m=ee.get(i.slice(l+1));m&&(i=i.slice(0,l+1)+m);let s,r=1/0;for(let c of o){let d=y(n,c.sld,c.max);if(d>c.max)continue;let u=y(i,c.suffix,c.max?1:0);if(!(u>(c.max?1:0))&&d+u<r&&(s=c.domain,r=d+u,!r))break}return s!==void 0?s===e?void 0:s:m?`${n}.${i}`:void 0},pe=(e,o,a)=>z.has(e)||h(e,a)||!!w(o)?.has(e),A={allowUnicode:!0,allowQuoted:!0,allowIp:!1,requireTld:!0},X=(e,o,a,t,n)=>{let i=fe(o),l=ue(i,de(t),s=>pe(s,t,n))??i;if(l===o)return;let m=`${e}@${l}`;return R(m,a).fail?void 0:m},F=(e,o)=>e.replace(ie,(a,t)=>o[t]??"");function I(e,o={}){let a={allowUnicode:o.allowUnicode!==!1,allowQuoted:!!o.allowQuoted,allowIp:!!o.allowIp,requireTld:o.requireTld!==!1},t=typeof e=="string"?R(e,a):{email:"",local:"",domain:"",quoted:!1,ip:!1,localOk:!1,fail:e==null?["empty",f.empty]:["syntax",f.syntax]},n=w(o.allowDomains),i=t.fail,l=!1,m=!1,s=!1;if(!i){if(!t.ip&&!h(t.domain,n)&&(l=h(t.domain,M),m=z.has(t.domain),h(t.domain,w(o.blockDomains))&&(i=["blocked",f.blocked])),!t.quoted){let g=t.local.indexOf("+");s=U.has((g<0?t.local:t.local.slice(0,g)).toLowerCase().replace(/[._-]/g,""))}i||(l&&o.blockDisposable!==!1?i=["disposable",f.disposable]:m&&o.blockFree?i=["free",f.free]:s&&o.blockRole&&(i=["role",f.role]))}let r;o.suggest!==!1&&t.localOk&&!t.ip&&(!i||i[0]==="domain"||i[0]==="tld")&&(r=X(t.local,t.domain,a,o.domains,n));let c=o.messages??{},d={email:t.email,local:t.local,domain:t.domain,suggestion:r,char:i?.[2]},u=[];i&&u.push(F(c[i[0]]??i[1],d)),r&&u.push(F(c.suggestion??f.suggestion,d));let p={valid:!i,email:t.email,local:t.local,domain:t.domain,message:u.join(" "),disposable:l,free:m,role:s};return i&&(p.reason=i[0]),r&&(p.suggestion=r),p}function ge(e,o={}){return I(e,{...o,suggest:!1}).valid}function he(e,o={}){if(typeof e!="string")return;let a=e.trim(),t=a.lastIndexOf("@");if(t<=0||a.length>$)return;let n=a.slice(0,t),i=a.slice(t+1);if(R(`${n}@example.com`,A).fail)return;let l=X(n,i,A,o.domains);return l&&l.toLowerCase()!==a.toLowerCase()?l:void 0}function be(e,o={}){if(typeof e!="string")throw new TypeError(`normalize() expects a string, got ${e===null?"null":typeof e}`);let a=e.trim();E.test(a)&&(a=a.normalize("NFC"));let t=a.lastIndexOf("@");if(t<0)return o.lowercase===!1?a:a.toLowerCase();let n=a.slice(0,t),i=a.slice(t+1).toLowerCase();if(n[0]!=='"'){if(o.plusTags!==!1){let l=n.indexOf("+");l>0&&(n=n.slice(0,l))}o.gmailDots!==!1&&(i==="gmail.com"||i==="googlemail.com")&&(i="gmail.com",n=n.split(".").join("")),o.lowercase!==!1&&(n=n.toLowerCase())}return`${n}@${i}`}function ye(e){return typeof e=="string"&&h(B(e),M)}function xe(e){return typeof e=="string"&&z.has(B(e))}function ke(e){if(typeof e!="string")return!1;let o=e.trim(),a=o.lastIndexOf("@"),t=a<0?o:o.slice(0,a),n=t.indexOf("+");return n>=0&&(t=t.slice(0,n)),U.has(t.toLowerCase().replace(/[._-]/g,""))}var H=((e,o)=>I(e,o));Object.assign(H,{validate:I,isEmail:ge,suggest:he,normalize:be,isDisposable:ye,isFreeProvider:xe,isRole:ke});var ze=H;export{ze as default,Y as disposableDomains,G as freeProviders,ye as isDisposable,ge as isEmail,xe as isFreeProvider,ke as isRole,be as normalize,Z as popularDomains,J as roleAccounts,he as suggest,I as validate};
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "inboxok",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Email validation for forms: syntax, disposable domains, typo suggestions ('Did you mean ana@gmail.com?'), role and free-provider detection. Synchronous, no DNS, runs in browsers, edge and Node. Zero dependencies.",
5
+ "keywords": [
6
+ "email",
7
+ "email-validation",
8
+ "email-validator",
9
+ "validate-email",
10
+ "is-email",
11
+ "isemail",
12
+ "email-address",
13
+ "validation",
14
+ "validator",
15
+ "form-validation",
16
+ "disposable-email",
17
+ "disposable-email-domains",
18
+ "temporary-email",
19
+ "burner-email",
20
+ "mailcheck",
21
+ "typo",
22
+ "did-you-mean",
23
+ "email-suggestion",
24
+ "free-email",
25
+ "role-account",
26
+ "normalize-email",
27
+ "gmail",
28
+ "idn",
29
+ "browser",
30
+ "edge"
31
+ ],
32
+ "license": "MIT",
33
+ "type": "module",
34
+ "sideEffects": false,
35
+ "main": "./dist/index.cjs",
36
+ "module": "./dist/index.js",
37
+ "types": "./dist/index.d.ts",
38
+ "exports": {
39
+ ".": {
40
+ "import": {
41
+ "types": "./dist/index.d.ts",
42
+ "default": "./dist/index.js"
43
+ },
44
+ "require": {
45
+ "types": "./dist/index.d.cts",
46
+ "default": "./dist/index.cjs"
47
+ }
48
+ },
49
+ "./package.json": "./package.json"
50
+ },
51
+ "files": [
52
+ "dist",
53
+ "CHANGELOG.md"
54
+ ],
55
+ "engines": {
56
+ "node": ">=20"
57
+ },
58
+ "scripts": {
59
+ "build": "tsup",
60
+ "test": "vitest run",
61
+ "typecheck": "tsc -p .",
62
+ "prepublishOnly": "npm run typecheck && npm test && npm run build"
63
+ }
64
+ }