aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Starsprung <[email protected]>2020-06-23 23:55:08 -0700
committerGitHub <[email protected]>2020-06-23 23:55:08 -0700
commit1ab3b7a93b671884b75e8ee4a6c8aae2edc5ca57 (patch)
tree60469e8ea50e4e0d73b38507aeb528014e497ca5
parentbfe2c9906abd29b7d3d925e6d7cc41530c3a42b8 (diff)
downloadfaker-1ab3b7a93b671884b75e8ee4a6c8aae2edc5ca57.tar.xz
faker-1ab3b7a93b671884b75e8ee4a6c8aae2edc5ca57.zip
Make user agent deterministic
-rw-r--r--vendor/user-agent.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/vendor/user-agent.js b/vendor/user-agent.js
index 977fde46..95b252ae 100644
--- a/vendor/user-agent.js
+++ b/vendor/user-agent.js
@@ -43,7 +43,8 @@ function rnd(a, b) {
if (Object.prototype.toString.call(a) === "[object Array]") {
//returns a random element from array (a), even weighting
- return a[Math.floor(Math.random() * a.length)];
+ var faker = require('../');
+ return faker.random.arrayElement(a);
}
if (a && typeof a === 'object') {