From 175ddca375cef765cec8ca5bbc527a205c40bf25 Mon Sep 17 00:00:00 2001 From: polwex Date: Tue, 3 Jun 2025 15:41:31 +0700 Subject: preeeeettty much done FUCK YES --- src/lib/utils.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib/utils.ts') diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 0674dea..0f0c084 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -63,3 +63,8 @@ export function cleanIpa(ipa: string): string { const r2 = /[\[\]\/]/g; return ipa.replace(r1, "").replace(r2, ""); } + +export function randomFromArray(arr: T[]): T { + const idx = Math.floor(Math.random() * arr.length); + return arr[idx]!; +} -- cgit v1.2.3