( value: string, label: string )
| 22 | * description, or null when valid. |
| 23 | */ |
| 24 | export function folderStyleNameProblem( |
| 25 | value: string, |
| 26 | label: string |
| 27 | ): string | null { |
| 28 | if (value.length === 0) { |
| 29 | return `${label} must not be empty`; |
| 30 | } |
| 31 | |
| 32 | if (value === '.' || value === '..') { |
| 33 | return `${label} must not be '${value}'`; |
| 34 | } |
| 35 | |
| 36 | if (/[\\/]/u.test(value)) { |
| 37 | return `${label} must not contain path separators`; |
| 38 | } |
| 39 | |
| 40 | return null; |
| 41 | } |
no outgoing calls
no test coverage detected