Skip to content

Commit 4dd510d

Browse files
committed
CCM-10893 Update truncate
1 parent c7ddd24 commit 4dd510d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/src/utils/truncate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export function truncate(str: string, maxLength: number): string {
2-
const trimmed = str.trimEnd();
1+
export const truncate = (text: string, maxLength: number = 50): string => {
2+
const trimmed = text.trimEnd();
33

44
if (trimmed.length <= maxLength) {
55
return trimmed;
66
}
77

88
return trimmed.slice(0, maxLength).trimEnd() + '…';
9-
}
9+
};

0 commit comments

Comments
 (0)