Package: effect
Module: SchemaIssue
Represents a schema issue produced when a schema filter (refinement check) fails.
When to use
Use when you need to inspect a schema issue that records which refinement check rejected the value.
Details
actual is the raw input value that was tested (plain unknown, not
wrapped in Option).filter is the AST filter node that produced this issue.issue is the inner issue describing the failure reason.Example (Matching a Filter issue)
import { SchemaIssue } from "effect"
function describe(issue: SchemaIssue.Issue): string {
if (issue._tag === "Filter") {
return `Filter failed on: ${JSON.stringify(issue.actual)}`
}
return String(issue)
}
See
Leaf — terminal issue types that commonly appear as the inner issueCheckHook — formatter hook for Filter issuesSignature
declare class Filter { constructor(
/**
* The input value that caused the issue.
*/
actual: unknown,
/**
* The filter that failed.
*/
filter: SchemaAST.Filter<any>,
/**
* The issue that occurred.
*/
issue: Issue
) }
Since v4.0.0