users.ts
| 1 | import config from "../config.ts"; |
| 2 | import { ADMIN_USERNAME } from "../constants.ts"; |
| 3 | |
| 4 | /** Show OWNER_DISPLAY_NAME for the admin account, [Deleted user] for null, otherwise the raw username. */ |
| 5 | export function displayName(username: string | null | undefined): string { |
| 6 | if (!username) return "[Deleted user]"; |
| 7 | return username === ADMIN_USERNAME ? config.OWNER_DISPLAY_NAME : username; |
| 8 | } |
| 9 |