From 91ca09d6fec37e1c0a81369e8cf9e54cb028ba90 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 12 Nov 2018 22:40:43 -0800 Subject: [PATCH 1/2] refactor: drop usage of _.union --- packages/grpc-native-core/src/client_interceptors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-native-core/src/client_interceptors.js b/packages/grpc-native-core/src/client_interceptors.js index 5ef89a5d..c132e15b 100644 --- a/packages/grpc-native-core/src/client_interceptors.js +++ b/packages/grpc-native-core/src/client_interceptors.js @@ -751,7 +751,7 @@ function _startBatchIfReady(call, batch, batch_state, callback) { // Dependencies are met, start the batch and any deferred batches whose // dependencies are met as a result. call.startBatch(batch, callback); - completed_ops = _.union(completed_ops, batch_ops); + completed_ops = Array.from(new Set(completed_ops.concat(batch_ops))); deferred_batches = _.flatMap(deferred_batches, function(deferred_batch) { var deferred_batch_ops = _.keys(deferred_batch).map(Number); if (_areBatchRequirementsMet(deferred_batch_ops, completed_ops)) { From f7684457719bb3fa7875d77285a48d8b231c6171 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 15 Nov 2018 12:05:56 -0800 Subject: [PATCH 2/2] refactor: replace _.assign with Object.assign --- packages/grpc-native-core/src/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-native-core/src/client.js b/packages/grpc-native-core/src/client.js index c37ff1eb..31a1738c 100644 --- a/packages/grpc-native-core/src/client.js +++ b/packages/grpc-native-core/src/client.js @@ -950,7 +950,7 @@ exports.makeClientConstructor = function(methods, serviceName, } ServiceClient.prototype.$method_names[attrs.path] = name; // Associate all provided attributes with the method - _.assign(ServiceClient.prototype[name], attrs); + Object.assign(ServiceClient.prototype[name], attrs); if (attrs.originalName) { ServiceClient.prototype[attrs.originalName] = ServiceClient.prototype[name];