Merge pull request #644 from JustinBeckwith/omit

refactor: drop usage of _.omit
This commit is contained in:
Michael Lumish 2018-11-20 11:28:37 -08:00 committed by GitHub
commit 4beb092a60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -390,10 +390,17 @@ function Client(address, credentials, options) {
let channelOverride = options.channelOverride;
let channelFactoryOverride = options.channelFactoryOverride;
// Exclude channel options which have already been consumed
var channel_options = _.omit(options,
['interceptors', 'interceptor_providers',
'channelOverride', 'channelFactoryOverride',
'callInvocationTransformer']);
const ignoredKeys = [
'interceptors', 'interceptor_providers', 'channelOverride',
'channelFactoryOverride', 'callInvocationTransformer'
];
var channel_options = Object.getOwnPropertyNames(options)
.reduce((acc, key) => {
if (ignoredKeys.indexOf(key) === -1) {
acc[key] = options[key];
}
return acc;
}, {});
/* Private fields use $ as a prefix instead of _ because it is an invalid
* prefix of a method name */
if (channelOverride) {