UNPKG

next-validations

Version:

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

10 lines (8 loc) 250 B
import { assert, type Infer, type Schema } from '@typeschema/main'; export function typeschemaResolver<T extends Schema>(schema: T) { return { async validate(data: unknown): Promise<Infer<T>> { return assert(schema, data); }, }; }