UNPKG

foxts

Version:

Opinionated collection of common TypeScript utils by @SukkaW

2 lines (1 loc) 283 B
Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./random-int.js");exports.shuffleArray=function(r,t={}){let n,{copy:o=!1,random:a=Math.random}=t,l=o?r.slice():r,s=e.createRandomInt(a),u=0;for(let e=l.length-1;e>0;e--)u=s(0,e),n=l[e],l[e]=l[u],l[u]=n;return l};