UNPKG

@extra-array/shuffle.min

Version:

Rearranges values in arbitrary order.

1 lines 1.3 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).array_shuffle=e()}}(function(){return function(){return function e(n,r,t){function o(u,i){if(!r[u]){if(!n[u]){var l="function"==typeof require&&require;if(!i&&l)return l(u,!0);if(f)return f(u,!0);var a=new Error("Cannot find module '"+u+"'");throw a.code="MODULE_NOT_FOUND",a}var c=r[u]={exports:{}};n[u][0].call(c.exports,function(e){return o(n[u][1][e]||e)},c,c.exports,e,n,r,t)}return r[u].exports}for(var f="function"==typeof require&&require,u=0;u<t.length;u++)o(t[u]);return o}}()({1:[function(e,n,r){n.exports=function(e){return function(){var n=e+=1831565813;return n=Math.imul(n^n>>>15,1|n),(((n^=n+Math.imul(n^n>>>7,61|n))^n>>>14)>>>0)/4294967296}}},{}],2:[function(e,n,r){const t=e("./shuffle$");n.exports=function(e,n=Math.random()){return t(e.slice(),n)}},{"./shuffle$":3}],3:[function(e,n,r){const t=e("./_mulberry32");n.exports=function(e,n=Math.random()){for(var r=t(Math.floor(n*2**31)),o=0,f=e.length;o<f;o++){var u=Math.floor(r()*f),i=(n=Math.floor(r()*f),e[u]);e[u]=e[n],e[n]=i}return e}},{"./_mulberry32":1}]},{},[2])(2)});