(name: string)
| 43 | return result.replace(/-+/g, '-').replace(/\.+/g, '.').replace(/^[-.]+/, '').replace(/-+$/, '') || 'root'; |
| 44 | } |
| 45 | function validName(name: string): boolean { |
| 46 | return name.length > 0 && name.length <= 200 && /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/.test(name) |
| 47 | && !name.includes('..') && normalizedName(name) === name; |
| 48 | } |
| 49 | const nameHint = 'Use up to 200 letters, numbers, underscores, dots or single dashes. No spaces or leading dots.'; |
| 50 | |
| 51 | export default function AddProjectIndexDialog({ open, source, onClose, onOpenProject, onActivityChange, pollMs = 1500 }: AddProjectIndexDialogProps): JSX.Element | null { |
no test coverage detected