@zcorky/schema
Version:
Object schema validation written with TypeScript, inspired by dayjs and schema
7 lines (6 loc) • 451 B
TypeScript
import { IOptions } from './interface';
import { Type } from './type';
import * as Types from '../types';
export declare type ISchema = Type<object> | Type<string> | Type<number> | Type<boolean> | Type<any[]>;
export declare type IObject = typeof Types.object | typeof Types.string | typeof Types.number | typeof Types.boolean | typeof Types.array;
export declare function validate<S extends ISchema, V>(schema: S, value: V, options?: IOptions): any;