Module

x/zod/mod.ts>z.ZodArray

TypeScript-first schema validation with static type inference
Extremely Popular
Go to Latest
class z.ZodArray
extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]>
import { z } from "https://dotland.deno.dev/x/zod@v3.23.7/mod.ts";
const { ZodArray } = z;

Type Parameters

T extends ZodTypeAny
optional
Cardinality extends ArrayCardinality = "many"

Properties

readonly
element

Methods

_parse(input: ParseInput): ParseReturnType<this["_output"]>
length(len: number, message?: errorUtil.ErrMessage): this
max(maxLength: number, message?: errorUtil.ErrMessage): this
min(minLength: number, message?: errorUtil.ErrMessage): this
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">

Static Properties

create: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T>