MCPcopy Create free account
hub / github.com/emwalker/digraph / fetchJson

Function fetchJson

next/lib/useSession.ts:8–19  ·  view source on GitHub ↗
(
  input: RequestInfo,
  init?: RequestInit,
)

Source from the content-addressed store, hash-verified

6const sessionApiRoute = '/session'
7
8async function fetchJson<JSON = unknown>(
9 input: RequestInfo,
10 init?: RequestInit,
11): Promise<JSON> {
12 return fetch(input, {
13 headers: {
14 accept: 'application/json',
15 'content-type': 'application/json',
16 },
17 ...init,
18 }).then((res) => res.json())
19}
20
21function doLogin(url: string, { arg }: { arg: string }) {
22 return fetchJson<SessionData>(url, {

Callers 2

doLoginFunction · 0.85
doLogoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected