FilterIssueA single failure reported by a filter predicate. Used as the element type of the array arm of FilterOutput, and also accepted on its own.
Details
string: failure with that string as the message. Produces an SchemaIssue.InvalidValue wrapping the input, with the string used as the issue'smessageannotation.- SchemaIssue.Issue: a fully-formed issue, returned as-is.
{ path, issue }: failure attached to a nested path.issueis either astring(wrapped in an SchemaIssue.InvalidValue) or a full SchemaIssue.Issue; the result is wrapped in an SchemaIssue.Pointer at the givenpath.
export type type FilterIssue =
| string
| SchemaIssue.Issue
| {
readonly path: ReadonlyArray<PropertyKey>
readonly issue: string | SchemaIssue.Issue
}
A single failure reported by a filter predicate. Used as the element type
of the array arm of
FilterOutput
, and also accepted on its own.
Details
string: failure with that string as the message. Produces an
SchemaIssue.InvalidValue
wrapping the input, with the string used as
the issue's message annotation.
SchemaIssue.Issue
: a fully-formed issue, returned as-is.
{ path, issue }: failure attached to a nested path. issue is either
a string (wrapped in an
SchemaIssue.InvalidValue
) or a full
SchemaIssue.Issue
; the result is wrapped in an
SchemaIssue.Pointer
at the given path.
FilterIssue = string | import SchemaIssueSchemaIssue.type Issue =
| SchemaIssue.Leaf
| SchemaIssue.Filter
| SchemaIssue.Encoding
| SchemaIssue.Pointer
| SchemaIssue.Composite
| SchemaIssue.AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue | {
readonly path: readonly PropertyKey[]path: interface ReadonlyArray<T>ReadonlyArray<type PropertyKey =
| string
| number
| symbol
PropertyKey>
readonly issue: string | SchemaIssue.Issueissue: string | import SchemaIssueSchemaIssue.type Issue =
| SchemaIssue.Leaf
| SchemaIssue.Filter
| SchemaIssue.Encoding
| SchemaIssue.Pointer
| SchemaIssue.Composite
| SchemaIssue.AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue
}