MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / dirname

Function dirname

server/utils/import-resolver.ts:51–54  ·  view source on GitHub ↗

* Get the directory of a file path.

(path: string)

Source from the content-addressed store, hash-verified

49 * Get the directory of a file path.
50 */
51function dirname(path: string): string {
52 const lastSlash = path.lastIndexOf('/')
53 return lastSlash === -1 ? '' : path.substring(0, lastSlash)
54}
55
56/**
57 * Get file extension priority order based on source file type.

Callers 3

writeFixtureFunction · 0.85
generateEsmTypesFixtureFunction · 0.85
resolveRelativeImportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected