mirror of https://github.com/grpc/grpc-node.git
Native: Protobuf.js 6 loadObject: switch to nestedArray
This commit is contained in:
parent
d7ee7796ec
commit
f45dda46af
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue