MCPcopy Create free account
hub / github.com/massCodeIO/massCode / basename

Function basename

src/main/http/import/opencollection.ts:59–64  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

57}
58
59function basename(path: string): string {
60 const normalized = normalizePath(path)
61 const index = normalized.lastIndexOf('/')
62 const name = index === -1 ? normalized : normalized.slice(index + 1)
63 return name.replace(/\.(ya?ml)$/i, '')
64}
65
66function stripRootDir(path: string, rootDir: string): string {
67 const normalized = normalizePath(path)

Callers 4

parseEnvironmentFunction · 0.70
parseRequestFunction · 0.70
parseBundledCollectionFunction · 0.70
parseOpenCollectionFilesFunction · 0.70

Calls 1

normalizePathFunction · 0.85

Tested by

no test coverage detected