fix: fix TS error by using generics on shuffle

This commit is contained in:
Kendell R 2024-01-11 07:00:26 -08:00
parent c90201f5f0
commit 740056b212
No known key found for this signature in database
GPG Key ID: 64314E306EEF6109

View File

@ -38,7 +38,7 @@
} }
} }
const shuffle = (array: unknown[]) => const shuffle = <T,>(array: T[]) =>
array array
.map((value) => ({ value, sort: Math.random() })) .map((value) => ({ value, sort: Math.random() }))
.sort((a, b) => a.sort - b.sort) .sort((a, b) => a.sort - b.sort)