fix exports

This commit is contained in:
Matteo Pagliazzi
2019-10-01 17:53:48 +02:00
parent 4faa06f37d
commit cca5b8492b
144 changed files with 271 additions and 315 deletions

View File

@@ -1,13 +1,13 @@
import values from 'lodash/values';
import keys from 'lodash/keys';
function trueRandom () {
export function trueRandom () {
return Math.random();
}
// Get a random property from an object
// returns random property (the value)
module.exports = function randomVal (obj, options = {}) {
export default function randomVal (obj, options = {}) {
let array = options.key ? keys(obj) : values(obj);
let random = options.predictableRandom || trueRandom();
@@ -16,6 +16,4 @@ module.exports = function randomVal (obj, options = {}) {
let randomIndex = Math.floor(random * array.length);
return array[randomIndex];
};
module.exports.trueRandom = trueRandom;
}