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

Function encodeSchema

packages/effect/src/encoding/Ndjson.ts:158–169  ·  view source on GitHub ↗
(
  schema: S
)

Source from the content-addressed store, hash-verified

156 * @since 4.0.0
157 */
158export const encodeSchema = <S extends Schema.Constraint>(
159 schema: S
160) =>
161<IE = never, Done = unknown>(): Channel.Channel<
162 Arr.NonEmptyReadonlyArray<Uint8Array>,
163 NdjsonError | Schema.SchemaError | IE,
164 Done,
165 Arr.NonEmptyReadonlyArray<S["Type"]>,
166 IE,
167 Done,
168 S["EncodingServices"]
169> => Channel.pipeTo(ChannelSchema.encode(schema)(), encode())
170
171/**
172 * Creates an NDJSON string encoder channel for values of a schema.

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.80
encodeFunction · 0.70

Tested by

no test coverage detected