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

Function readBody

packages/platform/bun/test/BunHttpPlatform.test.ts:7–10  ·  view source on GitHub ↗
(body: HttpBody.HttpBody)

Source from the content-addressed store, hash-verified

5import * as HttpPlatform from "effect/unstable/http/HttpPlatform"
6
7const readBody = (body: HttpBody.HttpBody) => {
8 assert.strictEqual(body._tag, "Raw")
9 return Effect.promise(() => new Response((body as HttpBody.Raw).body as BodyInit).text())
10}
11
12describe("BunHttpPlatform", () => {
13 it.effect("fileWebResponse honors offset and bytesToRead including zero", () =>

Callers 1

Calls 1

textMethod · 0.45

Tested by

no test coverage detected