mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
refactor: Move user argument to options in randomVal function
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user