MCPcopy Create free account
hub / github.com/Effect-TS/effect / json

Method json

packages/platform/node/src/NodeHttpClient.ts:258–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256 }
257
258 get json(): Effect.Effect<Schema.Json, Error.HttpClientError> {
259 return Effect.flatMap(this.text, (text) =>
260 Effect.try({
261 try: () => text === "" ? null : JSON.parse(text),
262 catch: (cause) =>
263 new Error.HttpClientError({
264 reason: new Error.DecodeError({
265 request: this.request,
266 response: this,
267 cause
268 })
269 })
270 }))
271 }
272
273 private textBody?: Effect.Effect<string, Error.HttpClientError>
274 get text(): Effect.Effect<string, Error.HttpClientError> {

Callers 2

HttpApi.test.tsFile · 0.45

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected