MCPcopy Create free account
hub / github.com/TanStack/cli / dirnamePath

Function dirnamePath

packages/create/src/edge-path.ts:49–67  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

47}
48
49export function dirnamePath(path: string): string {
50 const normalized = normalizePath(path)
51 if (normalized === '/') {
52 return '/'
53 }
54
55 const parts = normalized.split('/')
56 parts.pop()
57
58 if (!parts.length) {
59 return '.'
60 }
61
62 if (parts.length === 1 && parts[0] === '') {
63 return '/'
64 }
65
66 return parts.join('/') || '.'
67}
68
69export function extnamePath(path: string): string {
70 const basename = basenamePath(path)

Callers

nothing calls this directly

Calls 1

normalizePathFunction · 0.70

Tested by

no test coverage detected