@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

main
ts 9 lines 263 Bytes
Raw
1 export function truncate(text: string, maxLength = 50): string {
2 const trimmed = text.trim();
3 const characters = Array.from(trimmed);
4 if (characters.length <= maxLength) {
5 return trimmed;
6 }
7
8 return `${characters.slice(0, maxLength).join("")}...`;
9 }