Add variantOf null check

This commit is contained in:
Samuel Lorch 2024-07-30 18:27:48 +02:00
parent 43454b1641
commit b360bdf978

View file

@ -16,6 +16,7 @@ export function isNullish(value: any) {
}
export function variantOf(enumValue: any) {
if (enumValue === null) return null;
if (typeof enumValue === 'string') return enumValue;
else return Object.entries(enumValue)[0][0];
}