Native: Protobuf.js 6: use nested again

This commit is contained in:
murgatroid99 2018-12-11 10:53:47 -08:00
parent d43508d096
commit effeba7e78
1 changed files with 6 additions and 4 deletions

View File

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