Merge pull request #642 from JustinBeckwith/mapvalues

refactor: drop usage of _.mapValues
This commit is contained in:
Michael Lumish 2018-11-19 14:33:32 -08:00 committed by GitHub
commit cdac42a34f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -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;
}, {});
};
/**