(username: string | null)
| 98 | * Formats the welcome message based on username |
| 99 | */ |
| 100 | export function formatWelcomeMessage(username: string | null): string { |
| 101 | if (!username || username.length > MAX_USERNAME_LENGTH) { |
| 102 | return 'Welcome back!' |
| 103 | } |
| 104 | return `Welcome back ${username}!` |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Truncates a path in the middle if it's too long. |