MCPcopy
hub / github.com/vitejs/vite / toValidPackageName

Function toValidPackageName

packages/create-vite/src/index.ts:751–758  ·  view source on GitHub ↗
(projectName: string)

Source from the content-addressed store, hash-verified

749}
750
751function toValidPackageName(projectName: string) {
752 return projectName
753 .trim()
754 .toLowerCase()
755 .replace(/\s+/g, '-')
756 .replace(/^[._]/, '')
757 .replace(/[^a-z\d\-~]+/g, '-')
758}
759
760function copyDir(srcDir: string, destDir: string) {
761 fs.mkdirSync(destDir, { recursive: true })

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected