From 59cbc8b474425225f7f188ce54bc19d5f1193ecb Mon Sep 17 00:00:00 2001 From: Thongrapee Panyapatiphan Date: Sat, 22 Jan 2022 01:50:57 +0700 Subject: Announce current song (#470) Co-authored-by: Max Isom --- src/utils/string.ts | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/utils/string.ts (limited to 'src/utils/string.ts') 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; -- cgit v1.2.3