users.ts
Raw
1import config from "../config.ts";
2import { ADMIN_USERNAME } from "../constants.ts";
3
4/** Show OWNER_DISPLAY_NAME for the admin account, [Deleted user] for null, otherwise the raw username. */
5export 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