mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 07:37:55 -05:00
maplist when generating matches
This commit is contained in:
6
lib/shuffleArray.ts
Normal file
6
lib/shuffleArray.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export const shuffleArray = (array: string[]) => {
|
||||
return array
|
||||
.map((a) => ({ sort: Math.random(), value: a }))
|
||||
.sort((a, b) => a.sort - b.sort)
|
||||
.map((a) => a.value);
|
||||
};
|
||||
Reference in New Issue
Block a user