MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / fetchJson

Function fetchJson

scripts/check-stream-reliability.mjs:20–28  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

18}
19
20async function fetchJson(path) {
21 const response = await fetch(endpoint(path), { cache: "no-store" });
22 if (!response.ok) {
23 throw new Error(
24 `${path} returned ${response.status}: ${await response.text()}`,
25 );
26 }
27 return response.json();
28}
29
30function streamKey(stream) {
31 return `${stream.clientId ?? "unknown"}:${stream.kind ?? "unknown"}`;

Callers 1

Calls 4

fetchFunction · 0.85
jsonMethod · 0.80
endpointFunction · 0.70
textMethod · 0.65

Tested by

no test coverage detected