Skip to content

schema

schema

Type Aliases

StandardSchemaIssue

type StandardSchemaIssue = StandardSchemaV1.Issue;

Defined in: schema/index.ts:4

Functions

typeGuard()

function typeGuard<S>(schema, value): value is InferOutput<S>;

Defined in: schema/index.ts:14

Schema-backed type guard. Returns true + narrows to the schema's inferred type. Every isX(value: unknown): value is X guard that checks multiple fields should use this instead of hand-rolled duck typing.

Type Parameters

Type Parameter
S extends StandardSchemaV1<unknown, unknown>

Parameters

Parameter Type
schema S
value unknown

Returns

value is InferOutput<S>