Skip to main content
Module

x/abstruct/mod.ts>Validator

Abstract structure for JavaScript data validation
Latest
interface Validator
import { type Validator } from "https://deno.land/x/abstruct@1.0.0/mod.ts";

Validator API.

Type Parameters

optional
In = unknown
optional
RIn extends In = In

Properties

validate: (input: In) => Iterable<ValidationFailure>

Validates the input and yield validation errors if exists.

is: (input: In) => input is RIn

Whether the input is valid or not.