Revert "No longer remove dots from normalized emails"

This reverts commit 8b3a94928a.
This commit is contained in:
Konstantin Wohlwend 2025-07-03 14:35:56 -07:00
parent 668ab68ebb
commit d58dda3ed8

View File

@ -373,6 +373,8 @@ export function normalizeEmail(email: string): string {
throw new TypeError('normalize-email expects a string');
}
const removeDotsDomains = ['gmail.com', 'googlemail.com', 'live.com'];
const emailLower = email.trim().toLowerCase();
const emailParts = emailLower.split(/@/);
@ -382,6 +384,10 @@ export function normalizeEmail(email: string): string {
let [username, domain] = emailParts;
if (removeDotsDomains.includes(domain)) {
username = username.replace(/\.+/g, '');
}
return `${username}@${domain}`;
}