export const isValueInEnum = <T extends Record<PropertyKey, unknown>>(
  value: T[keyof T] | string,
  enumeration: T
): value is T[keyof T] => {
  return Object.values(enumeration).includes(value);
};
export const enumFromValue = <T extends Record<PropertyKey, T[keyof T]>>(
  value: T[keyof T] | string,
  enumeration: T
): T[keyof T] | undefined => {
  return isValueInEnum(value, enumeration) ? value : undefined;
};
