summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib/Enums.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/lib/Enums.ts')
-rw-r--r--frontend/src/lib/Enums.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/frontend/src/lib/Enums.ts b/frontend/src/lib/Enums.ts
index 876aec8..3264de4 100644
--- a/frontend/src/lib/Enums.ts
+++ b/frontend/src/lib/Enums.ts
@@ -15,6 +15,7 @@ import {
UpdateMode,
WorldSort
} from '$gql/graphql';
+import type { Key } from './Utils';
export interface EnumOption<T> {
id: T;
@@ -318,8 +319,6 @@ export const censorships: EnumOption<Censorship>[] = optionsFromLabel(Censorship
export const categories: EnumOption<Category>[] = optionsFromLabel(CategoryLabel);
export const languages: EnumOption<Language>[] = optionsFromLabel(LanguageLabel);
-function optionsFromLabel<T extends string | number | symbol>(
- labels: Record<T, string>
-): EnumOption<T>[] {
+function optionsFromLabel<T extends Key>(labels: Record<T, string>): EnumOption<T>[] {
return Object.entries(labels).map(([k, v]) => ({ id: k as T, name: v as string }));
}