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

Function encodeSchema

packages/effect/src/unstable/encoding/Sse.ts:470–487  ·  view source on GitHub ↗
(schema: S)

Source from the content-addressed store, hash-verified

468 * @since 4.0.0
469 */
470export const encodeSchema = <
471 S extends EventCodec,
472 IE,
473 Done
474>(schema: S): Channel.Channel<
475 NonEmptyReadonlyArray<string>,
476 IE | Schema.SchemaError,
477 void,
478 NonEmptyReadonlyArray<S["Type"]>,
479 IE | Retry,
480 Done,
481 S["EncodingServices"]
482> =>
483 ChannelSchema.encode(Event.pipe(
484 Schema.decodeTo(schema, transformEvent)
485 ))<IE | Retry, Done>().pipe(
486 Channel.pipeTo(encode())
487 )
488
489/**
490 * Encoder capable of rendering an `Event` or `Retry` value as Server-Sent

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected