Files
streamyfin_mirror/utils/textTools.ts
2025-03-16 18:01:12 +01:00

8 lines
223 B
TypeScript

/*
* Truncate a text longer than a certain length
*/
export const tc = (text: string | null | undefined, length = 20) => {
if (!text) return "";
return text.length > length ? text.substr(0, length) + "..." : text;
};