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

Function decodeSchema

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

Source from the content-addressed store, hash-verified

231 * @since 4.0.0
232 */
233export const decodeSchema = <S extends Schema.Constraint>(
234 schema: S
235) =>
236<IE = never, Done = unknown>(options?: {
237 readonly ignoreEmptyLines?: boolean | undefined
238}): Channel.Channel<
239 Arr.NonEmptyReadonlyArray<S["Type"]>,
240 Schema.SchemaError | NdjsonError | IE,
241 Done,
242 Arr.NonEmptyReadonlyArray<Uint8Array>,
243 IE,
244 Done,
245 S["DecodingServices"]
246> => Channel.pipeTo(decode(options), ChannelSchema.decodeUnknown(schema)())
247
248/**
249 * Creates an NDJSON string decoder channel for values of a schema.

Callers

nothing calls this directly

Calls 1

decodeFunction · 0.70

Tested by

no test coverage detected