g3-toolkit API Reference
    Preparing search index...

    Function shortenLabel

    • Truncate to maxLength characters including the ellipsis. Returns the text unchanged when it already fits (so a caller can tell "no shortening possible" by identity). Code points, not UTF-16 units, so an astral character is never split.

      Parameters

      • text: string
      • maxLength: number

      Returns string