(name: string)
| 4 | const FALLBACK_PACKAGE_NAME = 'tanstack-app' |
| 5 | |
| 6 | export function sanitizePackageName(name: string): string { |
| 7 | return name |
| 8 | .toLowerCase() |
| 9 | .replace(/\s+/g, '-') // Replace spaces with hyphens |
| 10 | .replace(/_/g, '-') // Replace underscores with hyphens |
| 11 | .replace(/[^a-z0-9-]/g, '') // Remove invalid characters |
| 12 | .replace(/^[^a-z]+/, '') // Ensure it starts with a letter |
| 13 | .replace(/-+/g, '-') // Collapse multiple hyphens |
| 14 | .replace(/-$/, '') // Remove trailing hyphen |
| 15 | } |
| 16 | |
| 17 | export function getCurrentDirectoryName(): string { |
| 18 | return basename(process.cwd()) |
no test coverage detected