Produces a union of all value types of an object type T.
Available since v3.0.0
import type { ValueOf } from '@helpers4/type';
type ValueOf<T> = T[keyof T]
type Config = { host: string; port: number; secure: boolean };
type ConfigValue = ValueOf<Config>; // string | number | boolean
const STATUS = { OK: 200, NOT_FOUND: 404, ERROR: 500 } as const;
type StatusCode = ValueOf<typeof STATUS>; // 200 | 404 | 500
View source on GitHub