Skip to content
1 min read · 83 words

Function: passesSchema()

ts
function passesSchema(schema: Schema, value: unknown): boolean;

Defined in: src/lib/utils/validation.ts:16

Returns true if value satisfies schema without throwing.

Parameters

ParameterTypeDescription
schemaSchemaThe schema to validate against.
valueunknownThe value to test.

Returns

boolean

true when value passes the schema; false otherwise.

Remarks

Aborts on the first validation error. Use validateOrThrow or asyncValidateOrThrow when you need the full set of field errors.