feat(util): add middle truncate util function for npubs
This commit is contained in:
parent
89d7131f7d
commit
e14422fe68
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user