@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function validateDomain

    • Validates if the domain of an email matches the target domain.

      Parameters

      • email: string

        The email address to validate.

      • targetDomain: string

        The domain to check against.

      Returns boolean

      True if the email's domain matches the target domain, false otherwise.

      validateDomain("user@example.com", "example.com"); // true
      validateDomain("admin@other.com", "example.com"); // false