Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function makeRandomObj(recursive, obj) {
return _.reduce(new Array(chance.natural({min: 3, max: 7})), function(result, value, index) {
var val;
if (obj) {
result[chance.word()] = chance.word();
} else {
switch (index) {
case 1: {
val = recursive ? makeRandomObj(false, false) : makeRandomObj(false, true);
break;
}
default: {
val = chance.word();
break;
}
}