mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
start upgrading eslint
This commit is contained in:
@@ -8,12 +8,12 @@ export function trueRandom () {
|
||||
// Get a random property from an object
|
||||
// returns random property (the value)
|
||||
export default function randomVal (obj, options = {}) {
|
||||
let array = options.key ? keys(obj) : values(obj);
|
||||
let random = options.predictableRandom || trueRandom();
|
||||
const array = options.key ? keys(obj) : values(obj);
|
||||
const random = options.predictableRandom || trueRandom();
|
||||
|
||||
array.sort();
|
||||
|
||||
let randomIndex = Math.floor(random * array.length);
|
||||
const randomIndex = Math.floor(random * array.length);
|
||||
|
||||
return array[randomIndex];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user