Utility

This package includes several utility functions.

getLimitedText

function getLimitedText(
  text: string,
  limit?: number,
  optionsArg?: LimitedTextOptions
);

The text will be limited to the given character limit. Default limt are 30 characters + 3 characters for the ellipsis length ("..."). The options allow customizing the bevior:

text = getLimitedText(myText, 10, {
  ellipsis: "[...]",
  includesEllipsis: false,
  removeHtmlTags: false,
});