💾 Archived View for iich.space › src › util › truncate.ts captured on 2021-12-04 at 18:04:22.

View Raw

More Information

⬅️ Previous capture (2021-12-03)

-=-=-=-=-=-=-

export const truncate = (text: string, length: number): string => {
  return text.length > length - 3 ? `${text.slice(0, length - 3)}...` : text;
};