Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/valibot/src/methods/assert/assert.ts>assert

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
function assert
import { assert } from "https://deno.land/x/valibot@v1.0.0-beta.2-to-json-schema/src/methods/assert/assert.ts";

Checks if the input matches the schema. As this is an assertion function, it can be used as a type guard.

Type Parameters

TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>

Parameters

schema: TSchema

The schema to be used.

input: unknown

The input to be tested.

Returns

asserts input is InferInput<TSchema>