UNPKG

@divstake-nestjs/validators-registry

Version:

NestJS Validators registry Module for Lido Finance projects. Part of [DivStake NestJS Modules](https://github.com/skaibaLab/divstake-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;