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

Method toJSON

packages/effect/src/unstable/http/HttpBody.ts:241–250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239 this.contentLength = contentLength
240 }
241 toJSON(): unknown {
242 const toString = this.contentType.startsWith("text/") || this.contentType.endsWith("json")
243 return {
244 _id: "effect/HttpBody",
245 _tag: "Uint8Array",
246 body: toString ? new TextDecoder().decode(this.body) : `Uint8Array(${this.body.length})`,
247 contentType: this.contentType,
248 contentLength: this.contentLength
249 }
250 }
251}
252
253/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected