UNPKG

@catalist-nestjs/validators-registry

Version:

NestJS Validators registry Module for Catalist Finance projects. Part of [Catalist NestJS Modules](https://github.com/blockarchivelabs/catalist-nestjs-modules/#readme)

9 lines (8 loc) 332 B
import { z } from 'zod'; import { ZodType } from 'zod/lib/types'; /** * Parse Zod Type. If parsing fails - onFail in executed. * * onFail must throw Error */ export declare const parseAsTypeOrFail: <Output, Def, Input>(type: z.ZodType<Output, Def, Input>, data: unknown, onFail: (error: z.ZodError) => never) => Output;