MCPcopy
hub / github.com/tldraw/tldraw / pathToName

Function pathToName

packages/create-tldraw/src/utils.ts:24–26  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

22}
23
24export function pathToName(path: string) {
25 return toValidPackageName(basename(formatTargetDir(resolve(path))))
26}
27export function formatTargetDir(targetDir: string) {
28 return targetDir.trim().replace(/[/\\]+$/g, '')
29}

Callers 1

namePickerFunction · 0.90

Calls 3

toValidPackageNameFunction · 0.85
formatTargetDirFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…