mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
Add variantOf null check
This commit is contained in:
parent
43454b1641
commit
b360bdf978
1 changed files with 1 additions and 0 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue