(nestingLvl = 2, maxKeys = 3)
| 234 | } |
| 235 | |
| 236 | export function randomDictObject(nestingLvl = 2, maxKeys = 3) { |
| 237 | if (nestingLvl < 0 || !isNumber(nestingLvl)) { |
| 238 | return {END: true}; |
| 239 | } |
| 240 | return randomKeys(maxKeys).reduce((reduced, key) => { |
| 241 | reduced[key] = randomValue(nestingLvl); |
| 242 | return reduced; |
| 243 | }, {}); |
| 244 | } |
| 245 | |
| 246 | export function randomValues(nestingLvl = 2) { |
| 247 | return randomSelectMultiple(RANDOM_VALUE_PRODUCERS).map(gen => gen(nestingLvl)); |
no test coverage detected