<S extends Schema.Constraint>(schema: S): <I>(
input: I
) => input is I & S["Type"]Creates a type guard that checks whether an input satisfies the schema's decoded type side.
When to use
Use to build a type guard for checking the decoded side of a schema without exposing issue details.
Details
The guard returns true on successful validation and false when validation
fails only with schema issues, without exposing issue details.
Gotchas
Only causes made entirely of schema issues are converted to false. Causes
that contain defects, interruptions, or asynchronous work at this synchronous
boundary throw an Error whose cause is the underlying Cause.
export function function is<S extends Schema.Constraint>(
schema: S
): <I>(input: I) => input is I & S["Type"]
Creates a type guard that checks whether an input satisfies the schema's decoded
type side.
When to use
Use to build a type guard for checking the decoded side of a schema without
exposing issue details.
Details
The guard returns true on successful validation and false when validation
fails only with schema issues, without exposing issue details.
Gotchas
Only causes made entirely of schema issues are converted to false. Causes
that contain defects, interruptions, or asynchronous work at this synchronous
boundary throw an Error whose cause is the underlying Cause.
is<function (type parameter) S in is<S extends Schema.Constraint>(schema: S): <I>(input: I) => input is I & S["Type"]S extends import SchemaSchema.type Schema.Constraint = /*unresolved*/ anyConstraint>(schema: S extends Schema.Constraintschema: function (type parameter) S in is<S extends Schema.Constraint>(schema: S): <I>(input: I) => input is I & S["Type"]S): <function (type parameter) I in <I>(input: I): input is I & S["Type"]I>(input: Iinput: function (type parameter) I in <I>(input: I): input is I & S["Type"]I) => input: Iinput is function (type parameter) I in <I>(input: I): input is I & S["Type"]I & function (type parameter) S in is<S extends Schema.Constraint>(schema: S): <I>(input: I) => input is I & S["Type"]S["Type"] {
return function _is<T>(
ast: SchemaAST.AST
): <I>(input: I) => input is I & T
_is<function (type parameter) S in is<S extends Schema.Constraint>(schema: S): <I>(input: I) => input is I & S["Type"]S["Type"]>(schema: S extends Schema.Constraintschema.ast)
}