UNPKG

typia

Version:

Superfast runtime validators with only one line

22 lines (19 loc) 387 B
export type IValidation<T = unknown> = | IValidation.ISuccess<T> | IValidation.IFailure; export namespace IValidation { export interface ISuccess<T = unknown> { success: true; data: T; errors: []; } export interface IFailure { success: false; errors: IError[]; } export interface IError { path: string; expected: string; value: any; } }