diff options
| author | Max Isom <[email protected]> | 2022-01-26 12:58:33 -0500 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2022-01-26 12:58:33 -0500 |
| commit | aacb107f43db6b8c53d160b5913701959f81cf09 (patch) | |
| tree | a63d0717d03c84987b69d5af1c1f5b45ef019a4a /src/utils/string.ts | |
| parent | 09665af53ee1b1903fc9ea719722aa5dfdc26325 (diff) | |
| parent | af05210be4a8857ea707866192efa79b3945b314 (diff) | |
| download | muse-aacb107f43db6b8c53d160b5913701959f81cf09.tar.xz muse-aacb107f43db6b8c53d160b5913701959f81cf09.zip | |
Merge branch 'master' into feature/slash-commands
Diffstat (limited to 'src/utils/string.ts')
| -rw-r--r-- | src/utils/string.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/string.ts b/src/utils/string.ts new file mode 100644 index 0000000..0b49114 --- /dev/null +++ b/src/utils/string.ts @@ -0,0 +1,2 @@ +export const truncate = (text: string, maxLength = 50) => + text.length > maxLength ? `${text.slice(0, maxLength - 3)}...` : text; |
