(name: string, maxLength: number)
| 146 | * its own button rather than teaching by round-trip. |
| 147 | */ |
| 148 | export function trailNameProblem(name: string, maxLength: number): string | null { |
| 149 | const trimmed = name.trim(); |
| 150 | if (trimmed === '') return 'Give the trail a name.'; |
| 151 | if (trimmed.length > maxLength) return `That name is too long (max ${maxLength} characters).`; |
| 152 | return null; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * The trail this name would replace, or null when it would be a new one. |
no outgoing calls
no test coverage detected