Hyperlinkv0.8.0-beta.28

Schema

Schema.decodeEffectconsteffect/Schema.ts:1399
<S extends Constraint>(schema: S, options?: SchemaAST.ParseOptions): (
  input: S["Encoded"],
  options?: SchemaAST.ParseOptions
) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]>

Decodes a typed input (the schema's Encoded type) against a schema, returning an Effect that succeeds with the decoded value or fails with a SchemaError.

When to use

Use when you need to decode input already typed as the schema's Encoded type in an Effect whose failure channel is SchemaError.

Details

For unknown input use decodeUnknownEffect. Options may be provided either when creating the decoder or when applying it; application options override creation options.

Source effect/Schema.ts:13997 lines
export const decodeEffect: <S extends Constraint>(
  schema: S,
  options?: SchemaAST.ParseOptions
) => (
  input: S["Encoded"],
  options?: SchemaAST.ParseOptions
) => Effect.Effect<S["Type"], SchemaError, S["DecodingServices"]> = decodeUnknownEffect
Referenced by 1 symbols