Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/arktype/parse/ast/union.ts>inferUnion

TypeScript's 1:1 validator, optimized from editor to runtime
Latest
type alias inferUnion
import { type inferUnion } from "https://deno.land/x/arktype@v1.0.10-alpha/parse/ast/union.ts";
definition: isAny<l | r> extends true ? any : [l] extends [never] ? r : [r] extends [never] ? l : [asIn<l>, asIn<r>] extends [infer lIn, infer rIn] ? [equals<l, lIn>, equals<r, rIn>] extends [true, true] ? l | r : discriminatable<lIn, rIn> extends true ? l | r : error<undiscriminatableMorphUnionMessage> : never