UNPKG

@sontrx/typia

Version:

Superfast runtime validators with only one line

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