Files
documenso/apps/remix/app/utils/truncate-title.ts
David Nguyen b2af10173a fix: wip
2025-02-03 14:10:28 +11:00

11 lines
258 B
TypeScript

export const truncateTitle = (title: string, maxLength: number = 16) => {
if (title.length <= maxLength) {
return title;
}
const start = title.slice(0, maxLength / 2);
const end = title.slice(-maxLength / 2);
return `${start}.....${end}`;
};