()
| 3 | import { state } from "~/lib/state" |
| 4 | |
| 5 | export async function getGitHubUser() { |
| 6 | const response = await fetch(`${GITHUB_API_BASE_URL}/user`, { |
| 7 | headers: { |
| 8 | authorization: `token ${state.githubToken}`, |
| 9 | ...standardHeaders(), |
| 10 | }, |
| 11 | }) |
| 12 | |
| 13 | if (!response.ok) throw new HTTPError("Failed to get GitHub user", response) |
| 14 | |
| 15 | return (await response.json()) as GithubUserResponse |
| 16 | } |
| 17 | |
| 18 | // Trimmed for the sake of simplicity |
| 19 | interface GithubUserResponse { |
no test coverage detected
searching dependent graphs…