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

Function encodePackageName

scripts/generate-fixtures.ts:141–147  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

139}
140
141function encodePackageName(name: string): string {
142 // Encode scoped packages: @scope/name -> @scope%2Fname
143 if (name.startsWith('@')) {
144 return '@' + encodeURIComponent(name.slice(1))
145 }
146 return encodeURIComponent(name)
147}
148
149function packageToFilename(name: string): string {
150 return `${name}.json`

Callers 2

generatePackumentFixtureFunction · 0.70
generateDownloadsFixtureFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected