MCPcopy
hub / github.com/badges/shields / _requestJson

Method _requestJson

services/npm/npm-base.js:83–100  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

81 }
82
83 async _requestJson(data) {
84 let payload
85 if (data?.options?.headers?.Accept) {
86 payload = data
87 } else {
88 payload = {
89 ...data,
90 options: {
91 headers: {
92 // Use a custom Accept header because of this bug:
93 // <https://github.com/npm/npmjs.org/issues/163>
94 Accept: '*/*',
95 },
96 },
97 }
98 }
99 return super._requestJson(this.authHelper.withBearerAuthHeader(payload))
100 }
101
102 async fetchPackageData({ registryUrl, scope, packageName, tag }) {
103 registryUrl = registryUrl || this.constructor.defaultRegistryUrl

Callers 15

fetchPackageDataMethod · 0.95
fetchMethod · 0.95
fetchEndpointDataFunction · 0.45
fetchMethod · 0.45
fetchMethod · 0.45
fetchMethod · 0.45
fetchMethod · 0.45
fetchMethod · 0.45
fetchMethod · 0.45
fetchMethod · 0.45
fetchMethod · 0.45
handleMethod · 0.45

Calls 1

withBearerAuthHeaderMethod · 0.80

Tested by 1

handleMethod · 0.36