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