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

Function requestJson

packages/simdeck-test/src/index.ts:906–915  ·  view source on GitHub ↗
(
  endpoint: string,
  method: string,
  pathName: string,
  body?: unknown,
)

Source from the content-addressed store, hash-verified

904}
905
906function requestJson<T = unknown>(
907 endpoint: string,
908 method: string,
909 pathName: string,
910 body?: unknown,
911): Promise<T> {
912 return requestBuffer(endpoint, pathName, method, body).then((buffer) =>
913 JSON.parse(buffer.toString("utf8")),
914 );
915}
916
917function requestBuffer(
918 endpoint: string,

Callers 4

requestActionFunction · 0.85
createSessionFunction · 0.85
waitForHealthFunction · 0.85
requestOkFunction · 0.85

Calls 3

requestBufferFunction · 0.85
toStringMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected