Hey Eric! So this is by no means done. However, I am already too thankful for your patience.
Here's what I have been playing with so far in terms of approaches to this problem. (Looks not like much but I threw out a slew of other janky methods.)
var obj = {
"backlog": [],
"build": [{
"label": "circleci",
"actions": {
"show": "hello from [build, circleci, show]",
"run": "hello from [build, circleci, run]"
}
}],
"project": [{
"label": "server",
"actions": {
"compile": "hello from [project, server, compile]",
"lint": "hello from [project, server, lint]",
"test": "hello from [project, server, test]",
"run": "hello from [project, server, run]"
}
},
{
"label": "client",
"actions": {
"compile": "hello from [project, client, compile]",
"lint": "hello from [project, client, lint]",
"test": "hello from [project, client, test]"
}
},
{
"label": "all",
"actions": {
"compile": "hello from [project, all, compile]",
"lint": "hello from [project, all, lint]",
"test": "hello from [project, all, test]"
}
}
],
"coverage": [{
"label": "coveralls",
"actions": {
"show": "hello from [coverage, server, show]"
}
},
{
"label": "local",
"actions": {
"show": "hello from [coverage, client, show]"
}
}
]
}
var msg = obj.build[0].actions.show;
function sodo(object) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
console.log(msg);
}
}
}
sodo(obj);