Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Unionize

Unionize

@example
type Props = { name: string; age: number; visible: boolean };

  // Expect: { name: string; } | { age: number; } | { visible: boolean; }
  type UnionizedType = Unionize<Props>;
type Unionize<T extends object> = [P in keyof T]: [Q in P]: T[P][keyof T];

§Type Parameters

§
T extends object
[src]

§Type

§
[P in keyof T]: [Q in P]: T[P][keyof T]
[src]