Type alias EntriesToValues<T>

EntriesToValues<T>: T[number][1]

takes an array of 2-tuples (entries) of the form [key: string, value: any], and returns a union of the second element of each of the tuples (values). it practically functions like the elements of Object.values.

Type Parameters

  • T extends [string, any][]

Example

type MyValues = EntriesToValues<[["name", "john"], ["age", 30], ["title", string]]>
// type MyValues === ("john" | 30 | string)

Generated using TypeDoc