MCPcopy Index your code
hub / github.com/massCodeIO/massCode / basename

Function basename

src/main/http/import/openapi.ts:79–85  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

77}
78
79function basename(path: string): string {
80 const normalized = path.replaceAll('\\', '/')
81 const slashIndex = normalized.lastIndexOf('/')
82 const name
83 = slashIndex === -1 ? normalized : normalized.slice(slashIndex + 1)
84 return name.replace(/\.(?:json|ya?ml)$/i, '')
85}
86
87function resolveRef(root: UnknownRecord, value: unknown): unknown {
88 if (!isRecord(value) || typeof value.$ref !== 'string')

Callers 2

getCollectionNameFunction · 0.70
buildBodyFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected