atriusmaps-node-sdk
Version:
This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information
2 lines (1 loc) • 674 B
JavaScript
const n="undefined"!=typeof window&&window.Cypress?(t=12345678,function(){let n=t+=1831565813;return n=Math.imul(n^n>>>15,1|n),n^=n+Math.imul(n^n>>>7,61|n),((n^n>>>14)>>>0)/4294967296}):Math.random;var t;const o=(t,o)=>(null==o&&(o=t,t=0),Math.floor(n()*(o-t)+t));function e(n,t){t||(t=n),n>t&&(n=t);const e=[];if(n/t<.3){const r=new Set;for(;e.length<n;){const n=o(t);r.has(n)||(r.add(n),e.push(n))}}else{const r=Array.from({length:t},((n,t)=>t));for(let s=0;s<n;s++){const n=o(t-s);e.push(r[n]),r[n]=r[t-s-1]}}return e}const r=(n,t)=>t.map((t=>n[t])),s=n=>r(n,e(n.length)),l=(n,t=1)=>r(n,e(t,n.length));export{l as arrayPick,o as rand,e as randomSet,s as randomizeArray};