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

View File

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