MCPcopy Create free account
hub / github.com/anomalyco/opencode / json

Function json

packages/opencode/test/server/httpapi-session.test.ts:217–220  ·  view source on GitHub ↗
(response: HttpClientResponse.HttpClientResponse)

Source from the content-addressed store, hash-verified

215}
216
217function json<T>(response: HttpClientResponse.HttpClientResponse) {
218 if (response.status !== 200) return response.text.pipe(Effect.flatMap((text) => Effect.die(new Error(text))))
219 return response.json.pipe(Effect.map((value) => value as T))
220}
221
222function responseJson(response: HttpClientResponse.HttpClientResponse) {
223 return response.json

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected