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

x/deepmergets/src/types/utils.ts>TuplifyUnion

Deeply merge 2 or more objects respecting type information.
Latest
type alias TuplifyUnion
import { type TuplifyUnion } from "https://deno.land/x/deepmergets@v7.1.3/src/types/utils.ts";

Convert a union to a tuple.

Warning: The order of the elements is non-deterministic. Warning 2: The union maybe me modified by the TypeScript engine before convertion. Warning 3: This implementation relies on a hack/limitation in TypeScript.

Type Parameters

T
optional
L = LastOf<T>
definition: IsNever<T> extends true ? [] : [...TuplifyUnion<Exclude<T, L>>, L]