mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
(fix:settings) truncate long doc names
This commit is contained in:
4
frontend/src/utils/stringUtils.ts
Normal file
4
frontend/src/utils/stringUtils.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export function truncate(str: string, n: number) {
|
||||
// slices long strings and ends with ...
|
||||
return str.length > n ? str.slice(0, n - 1) + '...' : str;
|
||||
}
|
||||
Reference in New Issue
Block a user