MCPcopy Create free account
hub / github.com/cn-docs/vueuse / fetchContributors

Function fetchContributors

scripts/utils.ts:297–316  ·  view source on GitHub ↗
(page = 1)

Source from the content-addressed store, hash-verified

295}
296
297async function fetchContributors(page = 1) {
298 // contributors that contribute to repos other than `vueuse/vueuse`, required for contributor avatar to work
299 const additional = ['egoist', 'Tahul', 'BobbieGoede']
300
301 const collaborators: string[] = []
302 const data = await $fetch<{ login: string }[]>(`https://api.github.com/repos/vueuse/vueuse/contributors?per_page=100&page=${page}`, {
303 method: 'get',
304 headers: {
305 'content-type': 'application/json',
306 },
307 }) || []
308 collaborators.push(...data.map(i => i.login))
309 if (data.length === 100)
310 collaborators.push(...(await fetchContributors(page + 1)))
311
312 return Array.from(new Set([
313 ...collaborators.filter(collaborator => !['renovate[bot]', 'dependabot[bot]', 'renovate-bot'].includes(collaborator)),
314 ...additional,
315 ]))
316}
317
318export async function updateContributors() {
319 const collaborators = await fetchContributors()

Callers 1

updateContributorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected