mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
11 lines
258 B
TypeScript
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}`;
|
|
};
|