format, lint, more enums, revert fn rename

This commit is contained in:
Snarling
2022-10-05 14:52:48 -04:00
parent a78a84c5b5
commit 068533cd2f
23 changed files with 94 additions and 101 deletions
+4
View File
@@ -0,0 +1,4 @@
// This works for both enums and regular objects.
export function checkEnum<T extends Record<string, unknown>>(obj: T, value: unknown): value is T[keyof T] {
return Object.values(obj).includes(value);
}