MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / fetch

Function fetch

packages/react/src/api/shell-host.test.ts:26–34  ·  view source on GitHub ↗
(input, init)

Source from the content-addressed store, hash-verified

24const recordingFetch = (respond: (url: string) => Response) => {
25 const calls: Array<{ url: string; body: unknown; headers: Record<string, string> }> = [];
26 const fetch: typeof globalThis.fetch = async (input, init) => {
27 const url = String(input);
28 calls.push({
29 url,
30 body: typeof init?.body === "string" ? decodeRequestBody(init.body) : undefined,
31 headers: Object.fromEntries(new Headers(init?.headers).entries()),
32 });
33 return respond(url);
34 };
35 return { calls, fetch };
36};
37

Callers 7

pollFunction · 0.70
useLatestVersionFunction · 0.50
waitReadyFunction · 0.50
runFunction · 0.50

Calls 2

pushMethod · 0.80
respondFunction · 0.50

Tested by

no test coverage detected