MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / sanitizeProjectFolderName

Function sanitizeProjectFolderName

desktop/project-create.ts:23–35  ·  view source on GitHub ↗
(projectName: string)

Source from the content-addressed store, hash-verified

21const execFile = promisify(execFileCallback)
22
23function sanitizeProjectFolderName(projectName: string) {
24 let nextName = projectName
25 .trim()
26 .replaceAll(/[<>:"/\\|?*]/g, '-')
27 .replace(/\s+/g, ' ')
28
29 nextName = Array.from(nextName, (char) => {
30 const code = char.charCodeAt(0)
31 return code >= 0 && code <= 31 ? '-' : char
32 }).join('')
33
34 return nextName
35}
36
37export async function createProject(options: {
38 preferredProjectLocation: string | null

Callers 2

createProjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected