summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib/Enums.ts
diff options
context:
space:
mode:
authorWolfgang Müller2025-02-13 17:52:16 +0100
committerWolfgang Müller2025-02-13 17:52:16 +0100
commitdc4db405d2991d3ec6a114f3b08d3fccd057d3ee (patch)
tree2c620c9af2062ba09fa591f8b3ed961664adab58 /frontend/src/lib/Enums.ts
parent4df870d793123be95c8af031a340a39b5b8402ac (diff)
downloadhircine-dc4db405d2991d3ec6a114f3b08d3fccd057d3ee.tar.gz
frontend: Migrate to Svelte 5
Diffstat (limited to '')
-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 }));
}