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

Function getFixturePath

modules/runtime/server/cache.ts:45–66  ·  view source on GitHub ↗
(type: FixtureType, name: string)

Source from the content-addressed store, hash-verified

43}
44
45function getFixturePath(type: FixtureType, name: string): string {
46 const dir = FIXTURE_PATHS[type]
47 let filename: string
48
49 switch (type) {
50 case 'packument':
51 case 'downloads':
52 filename = `${name}.json`
53 break
54 case 'search':
55 filename = `${name.replace(/:/g, '-')}.json`
56 break
57 case 'org':
58 case 'user':
59 filename = `${name}.json`
60 break
61 default:
62 filename = `${name}.json`
63 }
64
65 return `${dir}:${filename.replace(/\//g, ':')}`
66}
67
68/**
69 * Parse a scoped package name with optional version.

Callers 4

processSingleFastNpmMetaFunction · 0.85
handleJsdelivrDataApiFunction · 0.85
fetchFromFixturesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected