UNPKG

vuito

Version:

Simple, lightweight, isomorphic, and template-based validation library.

21 lines (20 loc) 544 B
export type VRow = { test(value: unknown): boolean; onlyIf?(parent: Record<string, unknown>): boolean; message: string; }; export type VTemplateRow = Array<VRow> & { check(value: unknown, parent?: Record<string, unknown>): Promise<void>; }; export type VInputTemplate = { [key: string]: Array<VRow>; }; export type VKeys = { readonly [key: string]: VTemplateRow; }; export type VTemplate = VKeys & { check(object: Record<string, unknown>): Promise<void>; }; export type VLengthy = unknown & { length: number; };