Files
buzz/desktop/src/shared/lib/initials.ts
2026-04-21 13:03:48 -07:00

11 lines
247 B
TypeScript

/** Derive up to two uppercase initials from a display name. */
export function getInitials(name: string): string {
return name
.trim()
.split(/\s+/)
.map((part) => part[0] ?? "")
.join("")
.slice(0, 2)
.toUpperCase();
}