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

    Type Alias TruncateOptions

    type TruncateOptions = {
        ellipsisString?: string;
        position?: "start" | "middle" | "end";
        strictLength?: boolean;
        wordCutting?: boolean;
    }
    Index

    Properties

    ellipsisString?: string

    The string to use as ellipsis. Default is "…".

    position?: "start" | "middle" | "end"

    Position to truncate the string. Default is "end".

    strictLength?: boolean

    If true, and maxLength is less than or equal to the length of ellipsisString, the function will return an empty string. If false, it will return the non-truncated ellipsisString. Default is false.

    wordCutting?: boolean

    Whether to cut words when truncating. Default is true.

    If false, the function will try to avoid cutting words by looking for spaces. If no suitable space is found, it will cut at the maximum length.