blob: 4c62a5c03cdb735d723369f9f40bf77bdaaec850 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
import {sanitizeHandle} from '#/lib/strings/handles'
import type * as bsky from '#/types/bsky'
export function createSanitizedDisplayName(
profile: bsky.profile.AnyProfileView,
noAt = false,
) {
if (profile.displayName != null && profile.displayName !== '') {
return sanitizeDisplayName(profile.displayName)
} else {
return sanitizeHandle(profile.handle, noAt ? '' : '@')
}
}
|