@planet-a/affinity-node
Version:
API wrapper for the affinity.co API
11 lines (10 loc) • 429 B
TypeScript
/**
* @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;