MCPcopy Index your code
hub / github.com/Effect-TS/effect / schemaHeaders

Function schemaHeaders

packages/platform/src/HttpIncomingMessage.ts:75–81  ·  view source on GitHub ↗
(
  schema: Schema.Schema<A, I, R>,
  options?: ParseOptions | undefined
)

Source from the content-addressed store, hash-verified

73 * @category schema
74 */
75export const schemaHeaders = <A, I extends Readonly<Record<string, string | undefined>>, R>(
76 schema: Schema.Schema<A, I, R>,
77 options?: ParseOptions | undefined
78) => {
79 const parse = Schema.decodeUnknown(schema, options)
80 return <E>(self: HttpIncomingMessage<E>): Effect.Effect<A, ParseResult.ParseError, R> => parse(self.headers)
81}
82
83/**
84 * @since 1.0.0

Callers

nothing calls this directly

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected