MCPcopy
hub / github.com/Effect-TS/effect / convertBody

Function convertBody

packages/platform-node/src/internal/httpClientUndici.ts:75–93  ·  view source on GitHub ↗
(
  body: Body.HttpBody
)

Source from the content-addressed store, hash-verified

73 })
74
75function convertBody(
76 body: Body.HttpBody
77): Effect.Effect<Exclude<Undici.Dispatcher.DispatchOptions["body"], undefined>> {
78 switch (body._tag) {
79 case "Empty": {
80 return Effect.succeed(null)
81 }
82 case "Uint8Array":
83 case "Raw": {
84 return Effect.succeed(body.body as Uint8Array)
85 }
86 case "FormData": {
87 return Effect.succeed(body.formData as Undici.FormData)
88 }
89 case "Stream": {
90 return NodeStream.toReadable(body.stream)
91 }
92 }
93}
94
95function noopErrorHandler(_: any) {}
96

Callers 1

makeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…