(array: T[])
| 208 | }; |
| 209 | |
| 210 | export const shuffleArray = <T>(array: T[]): T[] => { |
| 211 | const newArray = array.slice(); |
| 212 | |
| 213 | // fisher-yates |
| 214 | for (let i = newArray.length - 1; i > 0; i -= 1) { |
| 215 | const j = Math.floor(Math.random() * (i + 1)); |
| 216 | |
| 217 | const temp = newArray[i]; |
| 218 | newArray[i] = newArray[j]; |
| 219 | newArray[j] = temp; |
| 220 | } |
| 221 | |
| 222 | return newArray; |
| 223 | }; |
| 224 | |
| 225 | export const initReactModal = ({ |
| 226 | modalObject, |
no outgoing calls
no test coverage detected