json-combine
Generate every possible combination of values
npm
npm install json-combine --save
usage
const flatten combine = ; // mutation to applyconst mutations = key: 'a.b.c' values:true false key: 'a.b.d.e' values:1 2 3 ; // base objectconst template = a: b: c: false d: e: 0 ; console;
Outputs an array of every possible combinations :
"a": "b": "c": true "d": "e": 1 "a": "b": "c": true "d": "e": 2 "a": "b": "c": true "d": "e": 3 "a": "b": "c": false "d": "e": 1 "a": "b": "c": false "d": "e": 2 "a": "b": "c": false "d": "e": 3
test
npm test