UNPKG

foxts

Version:

Opinionated collection of common TypeScript utils by @SukkaW

2 lines (1 loc) 236 B
import{createRandomInt as r}from"./random-int.mjs";function t(e,n={}){let o,{copy:f=!1,random:l=Math.random}=n,m=f?e.slice():e,a=r(l),i=0;for(let r=m.length-1;r>0;r--)i=a(0,r),o=m[r],m[r]=m[i],m[i]=o;return m}export{t as shuffleArray};