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

Function schemaNoBody

packages/effect/src/http/HttpClientResponse.ts:193–211  ·  view source on GitHub ↗
(
  schema: Schema.Codec<A, I, RD, RE>,
  options?: ParseOptions | undefined
)

Source from the content-addressed store, hash-verified

191 * @since 4.0.0
192 */
193export const schemaNoBody = <
194 A,
195 I extends {
196 readonly status?: number | undefined
197 readonly headers?: Readonly<Record<string, string>> | undefined
198 },
199 RD,
200 RE
201>(
202 schema: Schema.Codec<A, I, RD, RE>,
203 options?: ParseOptions | undefined
204) => {
205 const decode = Schema.decodeEffect(schema, options)
206 return (self: HttpClientResponse): Effect.Effect<A, Schema.SchemaError, RD> =>
207 decode({
208 status: self.status,
209 headers: self.headers
210 } as any as I)
211}
212
213/**
214 * Converts an effect producing an `HttpClientResponse` into a stream of response body bytes.

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.50
decodeEffectMethod · 0.45

Tested by

no test coverage detected