TruncateOptions
TruncateOptions =
object
Defined in: packages/core/src/string/truncate.ts:3
Properties
Section titled “Properties”ellipsisString?
Section titled “ellipsisString?”
optionalellipsisString?:string
Defined in: packages/core/src/string/truncate.ts:16
The string to use as ellipsis. Default is “…”.
position?
Section titled “position?”
optionalposition?:"start"|"middle"|"end"
Defined in: packages/core/src/string/truncate.ts:5
Position to truncate the string. Default is “end”.
strictLength?
Section titled “strictLength?”
optionalstrictLength?:boolean
Defined in: packages/core/src/string/truncate.ts:23
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 true.
wordCutting?
Section titled “wordCutting?”
optionalwordCutting?:boolean
Defined in: packages/core/src/string/truncate.ts:13
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.