- Adjusted .prettierrc to ensure consistent formatting with a newline at the end of the file. - Reformatted eslint.config.mjs for improved readability by aligning array elements. - Updated pnpm-lock.yaml to use single quotes for consistency across dependencies. - Simplified worktree setup in .cursor/worktrees.json for cleaner configuration. - Enhanced documentation in .cursor/plans to clarify architecture refactoring. - Refactored various service files for improved readability and maintainability, including rate-limiting and auth services. - Updated imports and exports across multiple files for consistency and clarity. - Improved error handling and logging in service methods to enhance debugging capabilities. - Streamlined utility functions for better performance and maintainability across the domain packages.
22 lines
494 B
TypeScript
22 lines
494 B
TypeScript
/**
|
|
* Toolkit - Email Utilities
|
|
*
|
|
* Email utility functions (extraction, normalization).
|
|
* For email validation, use functions from common/validation.ts
|
|
*/
|
|
|
|
/**
|
|
* 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();
|
|
}
|