UNPKG

dilswer

Version:

Blazingly fast data validation library with TypeScript integration.

18 lines (17 loc) 398 B
// src/validation-algorithms/ensure-data-type.ts import { validatedCircularValues } from "../data-types/types/recursive.mjs"; import { Path } from "./path.mjs"; var DEFAULT_ROOT = Path.init("$"); var assertType = (dataType, data) => { try { return dataType["~validate"]( DEFAULT_ROOT, data ); } finally { validatedCircularValues.clear(); } }; export { assertType };