UNPKG

dilswer

Version:

Blazingly fast data validation library with TypeScript integration.

9 lines (8 loc) 409 B
import type { AnyType } from "../data-types/type-types"; import type { InferDType, ReWrap } from "../data-types/type-utils"; /** * Checks the provided `data` against the `dataType` type * definition and throws an ValidationError if the `data` does * not conform to the `dataType` */ export declare const assertType: <DT extends AnyType>(type: DT, data: unknown) => asserts data is ReWrap<InferDType<DT>>;