UNPKG

464 BJavaScriptView Raw
1
2
3 /**
4 * Just a wrapper to Math.random. No methods inside mout/random should call
5 * Math.random() directly so we can inject the pseudo-random number
6 * generator if needed (ie. in case we need a seeded random or a better
7 * algorithm than the native one)
8 */
9 function random(){
10 return random.get();
11 }
12
13 // we expose the method so it can be swapped if needed
14 random.get = Math.random;
15
16 module.exports = random;
17
18