Skip to content

getEnumValue<T>

Get the value of an enum key.

Import:

import { getEnumValue } from '@mnaoumov/typescript-lib/enum';

Signature:

function getEnumValue(enumType: T, key: string): T[keyof T]

Parameters:

Parameter Type Description
enumType T The enum type.
key string The key to get the value of.

Returns: T[keyof T] — The value of the enum key.