@ac-essentials/misc-util
    Preparing search index...

    Function truncate

    • Truncates a string and adds an ellipsis at the specified position if it exceeds the maximum length.

      Parameters

      • text: string

        The input string to be truncated.

      • maxLength: number

        The maximum allowed length of the string including the ellipsis.

      • Optionaloptions: TruncateOptions

        Options to customize the ellipsis behavior.

      Returns string

      The truncated string with ellipsis if needed.