9 lines
212 B
TypeScript
9 lines
212 B
TypeScript
export function normalizeEmail(email?: string | null): string | null {
|
|
if (!email) {
|
|
return null;
|
|
}
|
|
|
|
const normalized = email.trim().toLowerCase();
|
|
return normalized.length > 0 ? normalized : null;
|
|
}
|