Package: effect
Module: SchemaGetter
Creates a getter that always fails with the given issue.
When to use
Use when you need a schema getter that unconditionally rejects input.
Details
Issue returned by f.Option<E> input for error context.Example (Defining an always-failing getter)
import { Option, SchemaGetter, SchemaIssue } from "effect"
const rejectAll = SchemaGetter.fail<string, string>(
(oe) => new SchemaIssue.InvalidValue(oe, { message: "not allowed" })
)
See
forbidden for a convenience helper for Forbidden issuescheckEffect to fail conditionally based on input valueSignature
declare const fail: <T, E>(f: (oe: Option.Option<E>) => SchemaIssue.Issue) => Getter<T, E>
Since v4.0.0