@eloritzkovitz/server-essentials
    Preparing search index...

    Function truncate

    • Truncates a string to a specified length and adds ellipsis if needed.

      Parameters

      • str: string

        The input string.

      • length: number

        The maximum length.

      • ellipsis: string = "..."

        The string to append (default: "...").

      Returns string

      The truncated string.