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

Function schemaNoBody

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

Source from the content-addressed store, hash-verified

117 * @since 4.0.0
118 */
119export const schemaNoBody = <
120 A,
121 I extends {
122 readonly status?: number | undefined
123 readonly headers?: Readonly<Record<string, string>> | undefined
124 },
125 RD,
126 RE
127>(
128 schema: Schema.Codec<A, I, RD, RE>,
129 options?: ParseOptions | undefined
130) => {
131 const decode = Schema.decodeEffect(schema.annotate({ options }))
132 return (self: HttpClientResponse): Effect.Effect<A, Schema.SchemaError, RD> =>
133 decode({
134 status: self.status,
135 headers: self.headers
136 } as any as I)
137}
138
139/**
140 * Converts an effect producing an `HttpClientResponse` into a stream of response body bytes.

Callers

nothing calls this directly

Calls 2

annotateMethod · 0.65
decodeFunction · 0.50

Tested by

no test coverage detected