2 Create a union of the given object's values, and optionally specify which keys to get the values from.
4 Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript.
16 import {ValueOf} from 'type-fest';
17 import data = require('./data.json');
19 export function getData(name: string): ValueOf<typeof data> {
23 export function onlyBar(name: string): ValueOf<typeof data, 'bar'> {
28 import {getData, onlyBar} from './main';
40 export type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];