phasmid - v2.0.1
    Preparing search index...

    Function normalizeEmail

    Phasmid: provider-aware email normalization and canonicalization.

    import { normalizeEmail, isSameEmail } from "Phasmid";

    normalizeEmail("John.Doe+newsletter@googlemail.com"); // "johndoe@gmail.com"
    isSameEmail("a.b@gmail.com", "ab@gmail.com"); // true
    • Normalize an email address to its canonical form.

      Applies the matching provider's rules (sub-address stripping, dot removal, case-folding, alias-domain collapsing) and returns the canonical string. Unknown domains get a conservative treatment: the domain is lowercased and the local part is left untouched. Invalid input is not run through any rule and comes back trimmed and otherwise unchanged.

      Parameters

      Returns string

      if email is not a string.