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

Function createHeaders

docs/website/scripts/update-github-stats.mjs:26–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26function createHeaders() {
27 const headers = {
28 'Accept': 'application/vnd.github+json',
29 'User-Agent': 'masscode-docs-build',
30 'X-GitHub-Api-Version': '2022-11-28',
31 }
32
33 // eslint-disable-next-line node/prefer-global/process
34 const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN
35
36 if (token)
37 headers.Authorization = `Bearer ${token}`
38
39 return headers
40}
41
42async function fetchJson(url) {
43 const response = await fetch(url, { headers: createHeaders() })

Callers 1

fetchJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected