mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 15:49:10 +00:00
15 lines
373 B
TypeScript
15 lines
373 B
TypeScript
import GenericObject from "../Types/GenericObject";
|
|
|
|
export default class EnumUtil {
|
|
public static isValidEnumValue<T extends GenericObject>(
|
|
enumType: T,
|
|
value: any,
|
|
): boolean {
|
|
return this.getValues(enumType).includes(value);
|
|
}
|
|
|
|
public static getValues<T extends GenericObject>(enumType: T): Array<string> {
|
|
return Object.values(enumType);
|
|
}
|
|
}
|