UNPKG

@planet-a/affinity-node

Version:
11 lines (10 loc) 429 B
/** * @internal * * Converts a value to the corresponding enum value (only works for string enums) * Borrowed from https://stackoverflow.com/questions/17380845 * @param val The value to convert * @param _enum The enum to match against * @returns The enum value or undefined if no match was found */ export declare const enumFromValue: <T extends Record<string, string>>(val: unknown, _enum: T) => T[keyof T] | undefined;