UNPKG

bguard

Version:

**bguard** is a powerful, flexible, and type-safe validation library for TypeScript. It allows developers to define validation schemas for their data structures and ensures that data conforms to the expected types and constraints.

23 lines (20 loc) 743 B
import { WithBGuardType } from '../../commonTypes.js'; import { CommonSchema, ValidatorContext } from '../../core.js'; import '../../InferType.js'; import '../../helpers/constants.js'; /** * @description Creates a new schema for validating date values. * @returns {WithBGuardType<DateSchema, Date>} A new instance of `DateSchema` for validating booleans. * @example * const schema = date(); * parseOrFail(schema, true); // Validates successfully * parseOrFail(schema, 'true'); // Throws a validation error * * @instance Of DateSchema */ declare function date(): WithBGuardType<DateSchema, Date>; declare class DateSchema extends CommonSchema { protected _date: number; constructor(ctx: ValidatorContext); } export { date };