MCPcopy
hub / github.com/tldraw/tldraw / formatTargetDir

Function formatTargetDir

packages/create-tldraw/src/utils.ts:27–29  ·  view source on GitHub ↗
(targetDir: string)

Source from the content-addressed store, hash-verified

25 return toValidPackageName(basename(formatTargetDir(resolve(path))))
26}
27export function formatTargetDir(targetDir: string) {
28 return targetDir.trim().replace(/[/\\]+$/g, '')
29}
30
31export function isValidPackageName(projectName: string) {
32 return /^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(projectName)

Callers 2

mainFunction · 0.90
pathToNameFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…