Native: Protobuf.js 6 loadObject: switch to nestedArray

This commit is contained in:
murgatroid99 2018-12-07 10:16:16 -08:00
parent d7ee7796ec
commit f45dda46af
1 changed files with 3 additions and 4 deletions

View File

@ -135,11 +135,10 @@ exports.loadObject = function loadObject(value, options) {
return client.makeClientConstructor(service_attrs);
}
if (value.hasOwnProperty('nested')) {
if (value.hasOwnProperty('nestedArray')) {
// It's a namespace or root object
Object.keys(value.nested).forEach(name => {
const nested = value.nested[name];
result[name] = loadObject(nested, options);
value.nestedArray.forEach(nested => {
result[nested.name] = loadObject(nested, options);
});
return result;
}