Commit 7c25308d authored by Michele Memoli's avatar Michele Memoli

Finding cartesian products of all inputs

parent d6419422
stories:
- As a user, I can do soemthing cool
- As a user, I can do another thing
- As a researcher, I know about something
orientation:
- landscape
- portrait
device:
- mobile
- tablet
platform:
- iOS
- android
resolution:
- small
- large
console.log('yo')
const stringify = require('csv-stringify');
const Combinatorics = require('js-combinatorics');
const yaml = require('node-yaml');
const input = yaml.readSync('./config.yml')
const values = Object.keys(input).reduce((curr, facet) => {
return curr.concat([input[facet]])
}, [])
const cp = Combinatorics.cartesianProduct(...values)
cp.map(scenario => {
console.log(scenario)
})
......@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
"start": "node index.js"
},
"repository": {
"type": "git",
......@@ -21,5 +21,13 @@
"bugs": {
"url": "https://gitlab.com/100shapes/options-scaffolder/issues"
},
"homepage": "https://gitlab.com/100shapes/options-scaffolder#README"
"homepage": "https://gitlab.com/100shapes/options-scaffolder#README",
"devDependencies": {
"nodemon": "^1.11.0"
},
"dependencies": {
"csv-stringify": "^1.0.4",
"js-combinatorics": "^0.5.2",
"node-yaml": "^3.1.0"
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment