From 81f40c345a16499f743360b5ce153028914d9419 Mon Sep 17 00:00:00 2001 From: enes Date: Wed, 4 Sep 2024 17:42:49 +0200 Subject: [PATCH] refactor: use ellipsis instead of 3 dots --- src/utils/string.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/utils/string.ts b/src/utils/string.ts index 9ac0f05..14eee83 100644 --- a/src/utils/string.ts +++ b/src/utils/string.ts @@ -1,5 +1,5 @@ /** - * Function will replace the middle of the string with 3 dots if length greater then + * Function will replace the middle of the string with ellipsis if length greater then * offset value * @param str string to shorten * @param offset of how many chars to keep in the beginning and the end @@ -9,10 +9,7 @@ export const shorten = (str: string, offset = 9) => { // return original string if it is not long enough if (str.length < offset * 2 + 4) return str - return `${str.slice(0, offset)}...${str.slice( - str.length - offset, - str.length - )}` + return `${str.slice(0, offset)}…${str.slice(str.length - offset, str.length)}` } export const stringToHex = (str: string) => {