Skip to content

Commit

Permalink
Merge pull request #6519 from spalger/implement/config/dotSeparatedKe…
Browse files Browse the repository at this point in the history
…ysInArray

[cli/serve] expand dot-separated keys in yaml arrays
  • Loading branch information
spalger committed Mar 17, 2016
2 parents 45e0b9c + c7d2f89 commit 5276617
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cli/serve/read_yaml_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ module.exports = function (path) {
_.forOwn(val, function (subVal, subKey) {
apply(config, subVal, key + '.' + subKey);
});
} else {
}
else if (_.isArray(val)) {
config[key] = [];
val.forEach((subVal, i) => {
apply(config, subVal, key + '.' + i);
});
}
else {
_.set(config, key, val);
}
}
Expand Down

0 comments on commit 5276617

Please sign in to comment.