feat: supports show connection detail
This commit is contained in:
6
src/utils/truncate-str.ts
Normal file
6
src/utils/truncate-str.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export const truncateStr = (str?: string, prefixLen = 16, maxLen = 56) => {
|
||||
if (!str || str.length <= maxLen) return str;
|
||||
return (
|
||||
str.slice(0, prefixLen) + " ... " + str.slice(-(maxLen - prefixLen - 5))
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user