@tremendous/help
    Preparing search index...

    Function isPublicTokenFormat

    • Validates a Tremendous public token format.

      Public tokens are generated by the backend and consist of uppercase letters (A-Z) and digits (0-9). They are case-sensitive and exactly 12 characters long.

      This function validates that the token:

      • Contains only uppercase letters and digits
      • Is exactly 12 characters long
      • Matches the backend's token generation format

      Parameters

      • token: string

        The public token to validate.

      Returns boolean

      • Returns true if the token is valid, otherwise false.
      isPublicTokenFormat("ABC123XYZ456"); // true
      isPublicTokenFormat("4WBP4HZYLVQM"); // true
      isPublicTokenFormat("ABC123"); // false (too short)
      isPublicTokenFormat("abc123xyz456"); // false (lowercase)
      isPublicTokenFormat("ABC-12345678"); // false (contains hyphen)
      isPublicTokenFormat(""); // false (empty)