mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 01:08:28 +02:00
Template Tag Function Editor (#67)

This commit is contained in:
4
src-web/lib/truncate.ts
Normal file
4
src-web/lib/truncate.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export function truncate(text: string, len: number): string {
|
||||
if (text.length <= len) return text;
|
||||
return text.slice(0, len) + '…';
|
||||
}
|
||||
Reference in New Issue
Block a user