fetchGithub = async (path, params) => {
const response = (await fetch(
`https://api.github.com${path}?${new URLSearchParams(params)}`,
{headers: {
...(hasApiKey && {authorization: `token ${Secret("GITHUB_ACCESS_TOKEN")}`}),
accept: "application/vnd.github.v3+json"
}}
));
mutable rateLimit = {
remaining: +response.headers.get("X-RateLimit-Remaining"),
reset: new Date(response.headers.get("X-RateLimit-Reset") * 1000)
};
return response.json()
}