Merge pull request #681 from nicolasnoble/node6-fix

Fix for node 6.
This commit is contained in:
Nicolas Noble 2018-12-12 15:07:20 -08:00 committed by GitHub
commit afa951c30a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -138,8 +138,9 @@ exports.loadObject = function loadObject(value, options) {
if (value.hasOwnProperty('nested')) {
// It's a namespace or root object
if (value.nested !== null && value.nested !== undefined) {
Object.values(value.nested).forEach(nested => {
result[nested.name] = loadObject(nested, options);
var values = Object.keys(value.nested).map(key => value.nested[key]);
values.forEach(nested => {
result[nested.name] = loadObject(nested, options);
});
}
return result;