MCPcopy Create free account
hub / github.com/FirefoxCSS-Store/FirefoxCSS-Store.github.io / parseRepo

Function parseRepo

scripts/repository-stats.mjs:42–51  ·  view source on GitHub ↗
(repository)

Source from the content-addressed store, hash-verified

40}
41
42function parseRepo(repository) {
43 const url = new URL(repository)
44 const [owner, name] = url.pathname.replace(/^\/|\/$/g, '').split('/')
45
46 if (!owner || !name) {
47 throw new Error(`Unsupported repository path: ${repository}`)
48 }
49
50 return { host: url.hostname.replace(/^www\./, ''), owner, name }
51}
52
53async function readGithub({ owner, name }) {
54 const headers = githubToken ? { Authorization: `Bearer ${githubToken}` } : {}

Callers 1

fetchRepositoryStatsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected