about summary refs log tree commit diff
path: root/src/lib/strings.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/strings.ts')
-rw-r--r--src/lib/strings.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/strings.ts b/src/lib/strings.ts
index cb79e8824..8b93fa933 100644
--- a/src/lib/strings.ts
+++ b/src/lib/strings.ts
@@ -188,10 +188,10 @@ export function createFullHandle(name: string, domain: string): string {
   return `${name}.${domain}`
 }
 
-export function enforceLen(str: string, len: number): string {
+export function enforceLen(str: string, len: number, ellipsis = false): string {
   str = str || ''
   if (str.length > len) {
-    return str.slice(0, len)
+    return str.slice(0, len) + (ellipsis ? '...' : '')
   }
   return str
 }