Skip to main content
Module

x/value_schema/dist-deno/schemas/boolean.ts

simple, easy-to-use, and declarative input validator; supports Node.js, TypeScript, and Deno
Go to Latest
File
import { NullableRules, UndefinableRules } from "../libs/publicTypes.ts";import { BooleanSchema, RulesForBoolean } from "../schemaClasses/BooleanSchema.ts";/** schema for boolean or null or undefined */export function boolean(options: RulesForBoolean & NullableRules & UndefinableRules): BooleanSchema<null | undefined>;/** schema for boolean or undefined */export function boolean(options: RulesForBoolean & UndefinableRules): BooleanSchema<undefined>;/** schema for boolean or null */export function boolean(rules: RulesForBoolean & NullableRules): BooleanSchema<null>;/** schema for boolean */export function boolean(rules: RulesForBoolean): BooleanSchema;/** schema for boolean */export function boolean(): BooleanSchema;/** * create schema * @param rules rules * @returns schema */export function boolean(rules: RulesForBoolean = {}): BooleanSchema { return new BooleanSchema(rules);}