Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/zod/mod.ts>ZodDiscriminatedUnion.create

Deno-powered framework for building business web apps
Go to Latest
method ZodDiscriminatedUnion.create
import { ZodDiscriminatedUnion } from "https://deno.land/x/netzo@0.3.91/deps/zod/mod.ts";

The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. However, it only allows a union of objects, all of which need to share a discriminator property. This property must have a different value for each object in the union.

Parameters

discriminator: Discriminator

the name of the discriminator property

options: Types

an array of object schemas

optional
params: RawCreateParams