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

Function schemaHeaders

packages/effect/src/unstable/http/HttpIncomingMessage.ts:100–106  ·  view source on GitHub ↗
(
  schema: Schema.ConstraintCodec<A, I, RD, unknown>,
  options?: ParseOptions | undefined
)

Source from the content-addressed store, hash-verified

98 * @since 4.0.0
99 */
100export const schemaHeaders = <A, I extends Readonly<Record<string, string | undefined>>, RD>(
101 schema: Schema.ConstraintCodec<A, I, RD, unknown>,
102 options?: ParseOptions | undefined
103) => {
104 const decode = Schema.decodeUnknownEffect(schema)
105 return <E>(self: HttpIncomingMessage<E>): Effect.Effect<A, Schema.SchemaError, RD> => decode(self.headers, options)
106}
107
108/**
109 * Context reference for the optional maximum size allowed when reading an incoming message body.

Callers

nothing calls this directly

Calls 1

decodeFunction · 0.50

Tested by

no test coverage detected