Merge pull request #6519 from spalger/implement/config/dotSeparatedKeysInArray

[cli/serve] expand dot-separated keys in yaml arrays
This commit is contained in:
Spencer 2016-03-17 08:45:59 -07:00
commit 52766176ff

View file

@ -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);
}
}