wonder-stuff
    Preparing search index...
    • Truncates a string by replacing the middle with an ellipsis.

      Parameters

      • str: string

        The string to be truncated.

      • maxLength: number

        The maximum length of a string before it must be truncated.

      Returns string

      The string, if it is less than or equal to maxLength; otherwise, the string truncated to maxLength - 3 characters with an ellipsis in the middle.