mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 13:43:39 +01:00

5 lines
140 B
TypeScript
5 lines
140 B
TypeScript
export function truncate(text: string, len: number): string {
|
|
if (text.length <= len) return text;
|
|
return text.slice(0, len) + '…';
|
|
}
|