Rezi
    Preparing search index...

    Function truncateStart

    • Truncate text from the start, preserving the end. Useful for file paths and URLs where the tail is most important.

      Parameters

      • text: string

        The text to truncate

      • maxWidth: number

        Maximum width in terminal cells

      Returns string

      Truncated text with ellipsis at start, or original if it fits

      truncateStart("/home/user/documents/project/src/index.ts", 20)
      // "…ject/src/index.ts"