about summary refs log tree commit diff
path: root/src/lib/functions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/functions.ts')
-rw-r--r--src/lib/functions.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/functions.ts b/src/lib/functions.ts
new file mode 100644
index 000000000..d6fbf5b92
--- /dev/null
+++ b/src/lib/functions.ts
@@ -0,0 +1,6 @@
+export function choose<U, T extends Record<string, U>>(
+  value: keyof T,
+  choices: T,
+): U {
+  return choices[value]
+}