MCPcopy
hub / github.com/coder/mux / getJsonBody

Function getJsonBody

src/node/services/copilot/copilotResponsesLanguageModel.test.ts:87–93  ·  view source on GitHub ↗
(init: RequestInit)

Source from the content-addressed store, hash-verified

85}
86
87function getJsonBody(init: RequestInit) {
88 if (typeof init.body !== "string") {
89 throw new Error("Expected JSON string request body");
90 }
91
92 return JSON.parse(init.body) as Record<string, unknown>;
93}
94
95function createCompletedResponse(finishReason: string) {
96 return {

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected