(array: T[])
| 220 | }; |
| 221 | |
| 222 | export const shuffleArray = <T>(array: T[]): T[] => { |
| 223 | const newArray = array.slice(); |
| 224 | |
| 225 | // fisher-yates |
| 226 | for (let i = newArray.length - 1; i > 0; i -= 1) { |
| 227 | const j = Math.floor(Math.random() * (i + 1)); |
| 228 | |
| 229 | const temp = newArray[i]; |
| 230 | newArray[i] = newArray[j]; |
| 231 | newArray[j] = temp; |
| 232 | } |
| 233 | |
| 234 | return newArray; |
| 235 | }; |
| 236 | |
| 237 | export const initReactModal = ({ |
| 238 | modalObject, |
no outgoing calls
no test coverage detected