remeda
Version:
A utility library for JavaScript and Typescript.
10 lines (7 loc) • 392 B
TypeScript
import { IfNever } from 'type-fest';
/**
* A union of all values of properties in T which are not keyed by a symbol,
* following the definition of `Object.values` and `Object.entries`.
*/
type EnumerableStringKeyedValueOf<T> = T extends unknown ? IfNever<Exclude<keyof T, symbol>, never, Required<T>[Exclude<keyof T, symbol>]> : never;
export type { EnumerableStringKeyedValueOf as E };