mirror of https://github.com/grpc/grpc-node.git
Merge pull request #642 from JustinBeckwith/mapvalues
refactor: drop usage of _.mapValues
This commit is contained in:
commit
cdac42a34f
|
|
@ -982,9 +982,13 @@ exports.getClientChannel = function(client) {
|
|||
* @returns {Object.<string, Interceptor[]>}
|
||||
*/
|
||||
exports.getClientInterceptors = function(client) {
|
||||
return _.mapValues(client.$method_definitions, function(def, name) {
|
||||
return client[name].interceptors;
|
||||
});
|
||||
return Object.keys(client.$method_definitions)
|
||||
.reduce((acc, key) => {
|
||||
if (typeof key === 'string') {
|
||||
acc[key] = client[key].interceptors;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue