Skip to main content
Module

x/zod/mod.ts>z.ZodFunction

TypeScript-first schema validation with static type inference
Extremely Popular
Go to Latest
import { z } from "https://deno.land/x/zod@v3.2/mod.ts";
const { ZodFunction } = z;

Type Parameters

Args extends ZodTuple<any>
Returns extends ZodTypeAny

Properties

args: <Items extends Parameters<ZodTuple["create"]>[0]>(...items: Items) => ZodFunction<ZodTuple<Items>, Returns>
implement: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => F
returns: <NewReturnType extends ZodType<any, any>>(returnType: NewReturnType) => ZodFunction<Args, NewReturnType>
validate

Static Properties

create: <T extends ZodTuple<any> = ZodTuple<[]>, U extends ZodTypeAny = ZodUnknown>(args?: T, returns?: U) => ZodFunction<T, U>