summaryrefslogtreecommitdiff
path: root/src/utils/strings.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/strings.ts')
-rw-r--r--src/utils/strings.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/utils/strings.ts b/src/utils/strings.ts
new file mode 100644
index 0000000..e5bc43e
--- /dev/null
+++ b/src/utils/strings.ts
@@ -0,0 +1 @@
+export const ellipsize = (str: string, len = 40) => (str.length > len ? `${str.slice(0, len - 1)}…` : str);