feat(util): add middle truncate util function for npubs

This commit is contained in:
en 2025-02-14 13:01:51 +01:00
parent 89d7131f7d
commit e14422fe68

View File

@ -273,3 +273,9 @@ export const normalizeUserSearchString = (str: string): string => {
str = removeAccents(str)
return str
}
export const truncate = (npub: string): string => {
const start = npub.substring(0, 4)
const end = npub.substring(npub.length - 4, npub.length)
return start + '…' + end
}