(issue: Filter): string | undefinedReturns the built-in CheckHook used by default formatters.
When to use
Use as the default filter renderer when customizing only the LeafHook.
Details
- Looks for a
messageannotation on the inner issue first, then on the filter itself. - Returns
undefinedwhen no annotation is found, causing the formatter to fall back to"Expected <filter>, got <actual>".
Source effect/SchemaIssue.ts:9583 lines
export const const defaultCheckHook: CheckHookReturns the built-in
CheckHook
used by default formatters.
When to use
Use as the default filter renderer when customizing only the
LeafHook
.
Details
- Looks for a
message annotation on the inner issue first, then on the
filter itself.
- Returns
undefined when no annotation is found, causing the formatter to
fall back to "Expected <filter>, got <actual>".
defaultCheckHook: type CheckHook = (
issue: Filter
) => string | undefined
Callback type used to format
Filter
issues into strings.
When to use
Use when customizing how
makeFormatterStandardSchemaV1
renders
filter failures.
Details
- Returns
string to override the message, or undefined to fall back to
the default formatting.
CheckHook = (issue: Filter(parameter) issue: {
_tag: 'Filter';
actual: unknown;
filter: SchemaAST.Filter<unknown>;
issue: Issue;
toString: (this: Issue) => string;
}
issue): string | undefined => {
return function findMessage(
issue: Issue
): string | undefined
findMessage(issue: Filter(parameter) issue: {
_tag: 'Filter';
actual: unknown;
filter: SchemaAST.Filter<unknown>;
issue: Issue;
toString: (this: Issue) => string;
}
issue.Filter.issue: IssueThe issue that occurred.
issue) ?? function findMessage(
issue: Issue
): string | undefined
findMessage(issue: Filter(parameter) issue: {
_tag: 'Filter';
actual: unknown;
filter: SchemaAST.Filter<unknown>;
issue: Issue;
toString: (this: Issue) => string;
}
issue)
}Referenced by 2 symbols