refactor: Move user argument to options in randomVal function

This commit is contained in:
Blade Barringer
2016-09-24 19:50:12 -05:00
parent 4df1601718
commit 966a50431f
7 changed files with 23 additions and 17 deletions

View File

@@ -7,9 +7,9 @@ function randomGenerator (user, seed, providedRandom) {
return providedRandom ? providedRandom(user, seed) : Math.random();
}
module.exports = function randomVal (user, obj, options = {}) {
module.exports = function randomVal (obj, options = {}) {
let array = options.key ? _.keys(obj) : _.values(obj);
let rand = randomGenerator(user, options.seed, options.randomFunc);
let rand = randomGenerator(options.user, options.seed, options.randomFunc);
array.sort();