Skip to main content
Module

x/enzastdlib/collections/object.ts>ValueOf

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
type alias ValueOf
import { type ValueOf } from "https://deno.land/x/enzastdlib@v0.0.4/collections/object.ts";

Returns all the values of an Object as a type union of its values.

Examples

Example 1

import type { ValueOf } from 'https://deno.land/x/enzastdlib/collections/mod.ts';

const MY_CONSTANT_OBJECT = {
    x: 1,
    y: 2,
    z: 3
} as const;

type MyValues = ValueOf<typeof MY_CONSTANT_OBJECT>; // `1 | 2 | 3`
definition: Obj[keyof Obj]