Fix for node 6.

This commit is contained in:
Nicolas "Pixel" Noble 2018-12-12 22:45:52 +01:00
parent 8b6ecb8303
commit f3b22bcbc0
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;