dilswer
Version:
Blazingly fast data validation library with TypeScript integration.
9 lines (8 loc) • 415 B
TypeScript
import type { AnyType } from "../data-types/type-types";
import type { ParseDataType, 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<ParseDataType<DT>>;