@emailcheck/email-validator-js
Version:
Advanced email validation with MX records, SMTP verification, disposable email detection, batch processing, and caching. Production-ready with TypeScript support.
23 lines (22 loc) • 810 B
TypeScript
/**
* Spam detection helper for contact form submissions.
* Detects artificially generated names using linguistic heuristics.
*/
/**
* Checks if a name appears to be spam/generated.
*
* Spam characteristics detected:
* - Exactly one space between two parts
* - Both parts contain only letters (no numbers/symbols)
* - Both parts are unusually long (15+ characters each)
* - Low vowel ratio (< 35%) - real words typically have higher vowel density
* - High uppercase ratio (> 30%) - indicating random capitalization
*
* @param name - The name to validate
* @returns true if the name appears to be spam, false otherwise
*
* @example
* isSpamName("FalDxivcRyvFRbMUOedpn KAtCqqnzliZxRoThK") // true
* isSpamName("John Doe") // false
*/
export declare function isSpamName(name: string): boolean;