mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
8 lines
231 B
TypeScript
8 lines
231 B
TypeScript
/*
|
|
* Truncate a text longer than a certain length
|
|
*/
|
|
export const tc = (text: string | null | undefined, length: number = 20) => {
|
|
if (!text) return "";
|
|
return text.length > length ? text.substr(0, length) + "..." : text;
|
|
};
|