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

View Raw

More Information

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

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