@emailcheck/email-validator-js 3.3.0 → 3.4.1
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/dist/index.d.ts +2 -0
- package/dist/index.esm.js +103 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +105 -4
- package/dist/index.js.map +1 -1
- package/dist/is-spam-email.d.ts +31 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spam detection helper for email addresses.
|
|
3
|
+
* Detects artificially generated email addresses using linguistic heuristics.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Checks if an email address appears to be spam/generated.
|
|
7
|
+
*
|
|
8
|
+
* Spam characteristics detected:
|
|
9
|
+
* - Unusually long local part (16+ characters before @)
|
|
10
|
+
* - Low vowel ratio (< 35%) - real words typically have higher vowel density
|
|
11
|
+
* - High uppercase ratio (> 30%) - indicating random capitalization
|
|
12
|
+
* - High consonant cluster ratio - many consecutive consonants
|
|
13
|
+
* - Repeated character patterns (e.g., "aaaa", "xxx")
|
|
14
|
+
* - Random-looking character sequences
|
|
15
|
+
*
|
|
16
|
+
* @param email - The email address to validate
|
|
17
|
+
* @returns true if the email appears to be spam, false otherwise
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* isSpamEmail("FalDxivcRyvFRbMU@example.com") // true
|
|
21
|
+
* isSpamEmail("john.doe@example.com") // false
|
|
22
|
+
*/
|
|
23
|
+
export declare function isSpamEmail(email: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Checks if an email address local part appears to be spam/generated.
|
|
26
|
+
* This is an alias for isSpamEmail with a more descriptive name.
|
|
27
|
+
*
|
|
28
|
+
* @param email - The email address to validate
|
|
29
|
+
* @returns true if the email local part appears to be spam, false otherwise
|
|
30
|
+
*/
|
|
31
|
+
export declare function isSpamEmailLocalPart(email: string): boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface VerificationResult {
|
|
|
28
28
|
domainAge?: DomainAgeInfo | null;
|
|
29
29
|
domainRegistration?: DomainRegistrationInfo | null;
|
|
30
30
|
domainSuggestion?: DomainSuggestion | null;
|
|
31
|
+
/** MX records found for the domain (if MX verification was performed) */
|
|
32
|
+
mxRecords?: string[] | null;
|
|
31
33
|
/** Whether SMTP connection was successful */
|
|
32
34
|
canConnectSmtp?: boolean;
|
|
33
35
|
/** Whether the mailbox is full */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emailcheck/email-validator-js",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Advanced email validation with MX records, SMTP verification, disposable email detection, batch processing, and caching. Production-ready with TypeScript support.",
|
|
6
6
|
"keywords": [
|