2025-10-03 14:26:55 +09:00
|
|
|
/**
|
2025-10-08 18:14:12 +09:00
|
|
|
* Toolkit - Email Utilities
|
2025-10-03 14:26:55 +09:00
|
|
|
*
|
2025-10-08 18:14:12 +09:00
|
|
|
* Email utility functions (extraction, normalization).
|
|
|
|
|
* For email validation, use functions from common/validation.ts
|
2025-10-03 14:26:55 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Extract domain from email address
|
|
|
|
|
*/
|
|
|
|
|
export function getEmailDomain(email: string): string | null {
|
|
|
|
|
const match = email.match(/@(.+)$/);
|
|
|
|
|
return match ? match[1] : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Normalize email address (lowercase, trim)
|
|
|
|
|
*/
|
|
|
|
|
export function normalizeEmail(email: string): string {
|
|
|
|
|
return email.trim().toLowerCase();
|
|
|
|
|
}
|
|
|
|
|
|