- Replace mobile placeholder with Expo Router app (tabs, playback, auth, library) - Move Convex backend to @otunes/convex for web and mobile reuse - Update web app imports and API routes to use shared package
9 lines
241 B
TypeScript
9 lines
241 B
TypeScript
export function shuffleArray<T>(array: T[]): T[] {
|
|
const copy = [...array]
|
|
for (let i = copy.length - 1; i > 0; i -= 1) {
|
|
const j = Math.floor(Math.random() * (i + 1))
|
|
;[copy[i], copy[j]] = [copy[j], copy[i]]
|
|
}
|
|
return copy
|
|
}
|