Hyperlinkv0.8.0-beta.28

ChannelSchema

ChannelSchema.decodeUnknownconsteffect/ChannelSchema.ts:133
<S extends Schema.Constraint>(schema: S): <
  IE = never,
  Done = unknown
>() => Channel.Channel<
  Arr.NonEmptyReadonlyArray<S["Type"]>,
  IE | Schema.SchemaError,
  Done,
  Arr.NonEmptyReadonlyArray<S["Encoded"]>,
  IE,
  Done,
  S["DecodingServices"]
>

Creates a decode channel variant for schema-decoding channel boundaries.

When to use

Use when you need an intentionally unknown or untyped encoded input while keeping only the decoded output statically typed according to the schema.

Details

The channel decodes non-empty encoded chunks into schema values, emits SchemaError when decoding fails, and requires the schema's decoding services.

constructorsdecode
export const decodeUnknown: <S extends Schema.Constraint>(
  schema: S
) => <IE = never, Done = unknown>() => Channel.Channel<
  Arr.NonEmptyReadonlyArray<S["Type"]>,
  IE | Schema.SchemaError,
  Done,
  Arr.NonEmptyReadonlyArray<S["Encoded"]>,
  IE,
  Done,
  S["DecodingServices"]
> = decode