Module

x/fluentci/deps.ts>z.ZodDiscriminatedUnion.create

This is the command line interface for FluentCI.
Go to Latest
method z.ZodDiscriminatedUnion.create
import { z } from "https://dotland.deno.dev/x/fluentci@v0.13.0/deps.ts";
const { ZodDiscriminatedUnion } = z;

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