@unikue/ts-lang-utils
    Preparing search index...

    Function maskEmail

    • Returns a masked email address, which keeps the first character of the local part and the whole domain

      Parameters

      • Optionaltext: string | null

        The text to mask

      Returns string | undefined

      a masked email address, or undefined if the given text is invalid

      David Hsing

      maskEmail(undefined);    // undefined
      maskEmail('user@example.com'); // 'u***@example.com'
      maskEmail('u@example.com'); // '*@example.com'
      maskEmail('invalid-email'); // undefined