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