Skip to contentOpen History to see the last commit
truncateTitle.ts
7 lines210 Bytes
1export function truncateTitle(text: string, maxLength = 50): string { 2 const trimmed = text.trim(); 3 if (trimmed.length <= maxLength) { 6 return `${trimmed.slice(0, maxLength)}...`;