From ade3ffab4c9be73d55f60a2625c1feb40b745cc4 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Sat, 21 Mar 2020 12:19:03 -0700 Subject: [PATCH] fix: gts linter complains about prefer-spread --- .../src/v1beta1/big_query_storage_client.ts.baseline | 3 ++- .../disable-packing-test/src/v1beta1/echo_client.ts.baseline | 3 ++- .../src/v1beta1/identity_client.ts.baseline | 3 ++- .../src/v1beta1/messaging_client.ts.baseline | 3 ++- .../src/v1beta1/testing_client.ts.baseline | 3 ++- baselines/dlp/src/v2/dlp_service_client.ts.baseline | 3 ++- baselines/kms/src/v1/key_management_service_client.ts.baseline | 3 ++- baselines/logging/src/v2/config_service_v2_client.ts.baseline | 3 ++- baselines/logging/src/v2/logging_service_v2_client.ts.baseline | 3 ++- baselines/logging/src/v2/metrics_service_v2_client.ts.baseline | 3 ++- .../monitoring/src/v3/alert_policy_service_client.ts.baseline | 3 ++- baselines/monitoring/src/v3/group_service_client.ts.baseline | 3 ++- baselines/monitoring/src/v3/metric_service_client.ts.baseline | 3 ++- .../src/v3/notification_channel_service_client.ts.baseline | 3 ++- .../src/v3/service_monitoring_service_client.ts.baseline | 3 ++- .../monitoring/src/v3/uptime_check_service_client.ts.baseline | 3 ++- baselines/redis/src/v1beta1/cloud_redis_client.ts.baseline | 3 ++- baselines/showcase/src/v1beta1/echo_client.ts.baseline | 3 ++- baselines/showcase/src/v1beta1/identity_client.ts.baseline | 3 ++- baselines/showcase/src/v1beta1/messaging_client.ts.baseline | 3 ++- baselines/showcase/src/v1beta1/testing_client.ts.baseline | 3 ++- .../texttospeech/src/v1/text_to_speech_client.ts.baseline | 3 ++- .../src/v3beta1/translation_service_client.ts.baseline | 3 ++- templates/typescript_gapic/src/$version/$service_client.ts.njk | 3 ++- 24 files changed, 48 insertions(+), 24 deletions(-) diff --git a/baselines/bigquery-storage/src/v1beta1/big_query_storage_client.ts.baseline b/baselines/bigquery-storage/src/v1beta1/big_query_storage_client.ts.baseline index be0a906b2..11b8b3e2c 100644 --- a/baselines/bigquery-storage/src/v1beta1/big_query_storage_client.ts.baseline +++ b/baselines/bigquery-storage/src/v1beta1/big_query_storage_client.ts.baseline @@ -200,7 +200,8 @@ export class BigQueryStorageClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline index 57ccbd3bc..02cbc8f8a 100644 --- a/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline @@ -252,7 +252,8 @@ export class EchoClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline index 066b2650e..4076a4933 100644 --- a/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline @@ -216,7 +216,8 @@ export class IdentityClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline index 94c5aa9cc..12556a024 100644 --- a/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline @@ -253,7 +253,8 @@ export class MessagingClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline index 26e2cc804..61ac23d10 100644 --- a/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline @@ -219,7 +219,8 @@ export class TestingClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/dlp/src/v2/dlp_service_client.ts.baseline b/baselines/dlp/src/v2/dlp_service_client.ts.baseline index a58d846af..2324e918e 100644 --- a/baselines/dlp/src/v2/dlp_service_client.ts.baseline +++ b/baselines/dlp/src/v2/dlp_service_client.ts.baseline @@ -241,7 +241,8 @@ export class DlpServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/kms/src/v1/key_management_service_client.ts.baseline b/baselines/kms/src/v1/key_management_service_client.ts.baseline index a1bab6ae5..55f178fc4 100644 --- a/baselines/kms/src/v1/key_management_service_client.ts.baseline +++ b/baselines/kms/src/v1/key_management_service_client.ts.baseline @@ -204,7 +204,8 @@ export class KeyManagementServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/logging/src/v2/config_service_v2_client.ts.baseline b/baselines/logging/src/v2/config_service_v2_client.ts.baseline index 736f83900..2b568daac 100644 --- a/baselines/logging/src/v2/config_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/config_service_v2_client.ts.baseline @@ -268,7 +268,8 @@ export class ConfigServiceV2Client { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline index cc44146d2..1e892e035 100644 --- a/baselines/logging/src/v2/logging_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/logging_service_v2_client.ts.baseline @@ -287,7 +287,8 @@ export class LoggingServiceV2Client { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline b/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline index de193c6fd..f6dc144d4 100644 --- a/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline +++ b/baselines/logging/src/v2/metrics_service_v2_client.ts.baseline @@ -261,7 +261,8 @@ export class MetricsServiceV2Client { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline b/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline index 5b2d8348f..147aedfc1 100644 --- a/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/alert_policy_service_client.ts.baseline @@ -275,7 +275,8 @@ export class AlertPolicyServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/monitoring/src/v3/group_service_client.ts.baseline b/baselines/monitoring/src/v3/group_service_client.ts.baseline index 070e368bb..1db029373 100644 --- a/baselines/monitoring/src/v3/group_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/group_service_client.ts.baseline @@ -280,7 +280,8 @@ export class GroupServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/monitoring/src/v3/metric_service_client.ts.baseline b/baselines/monitoring/src/v3/metric_service_client.ts.baseline index 8d77d5347..c2d6d7b43 100644 --- a/baselines/monitoring/src/v3/metric_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/metric_service_client.ts.baseline @@ -290,7 +290,8 @@ export class MetricServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline b/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline index 404effcfa..bfda02fdd 100644 --- a/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/notification_channel_service_client.ts.baseline @@ -270,7 +270,8 @@ export class NotificationChannelServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline b/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline index b6ad5afc5..180ea530b 100644 --- a/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/service_monitoring_service_client.ts.baseline @@ -272,7 +272,8 @@ export class ServiceMonitoringServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline b/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline index 676ceb339..5bb974ac4 100644 --- a/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline +++ b/baselines/monitoring/src/v3/uptime_check_service_client.ts.baseline @@ -276,7 +276,8 @@ export class UptimeCheckServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/redis/src/v1beta1/cloud_redis_client.ts.baseline b/baselines/redis/src/v1beta1/cloud_redis_client.ts.baseline index 878ed3dcc..da2a16102 100644 --- a/baselines/redis/src/v1beta1/cloud_redis_client.ts.baseline +++ b/baselines/redis/src/v1beta1/cloud_redis_client.ts.baseline @@ -279,7 +279,8 @@ export class CloudRedisClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/showcase/src/v1beta1/echo_client.ts.baseline b/baselines/showcase/src/v1beta1/echo_client.ts.baseline index 57ccbd3bc..02cbc8f8a 100644 --- a/baselines/showcase/src/v1beta1/echo_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/echo_client.ts.baseline @@ -252,7 +252,8 @@ export class EchoClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/showcase/src/v1beta1/identity_client.ts.baseline b/baselines/showcase/src/v1beta1/identity_client.ts.baseline index 066b2650e..4076a4933 100644 --- a/baselines/showcase/src/v1beta1/identity_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/identity_client.ts.baseline @@ -216,7 +216,8 @@ export class IdentityClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/showcase/src/v1beta1/messaging_client.ts.baseline b/baselines/showcase/src/v1beta1/messaging_client.ts.baseline index 94c5aa9cc..12556a024 100644 --- a/baselines/showcase/src/v1beta1/messaging_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/messaging_client.ts.baseline @@ -253,7 +253,8 @@ export class MessagingClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/showcase/src/v1beta1/testing_client.ts.baseline b/baselines/showcase/src/v1beta1/testing_client.ts.baseline index 26e2cc804..61ac23d10 100644 --- a/baselines/showcase/src/v1beta1/testing_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/testing_client.ts.baseline @@ -219,7 +219,8 @@ export class TestingClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/texttospeech/src/v1/text_to_speech_client.ts.baseline b/baselines/texttospeech/src/v1/text_to_speech_client.ts.baseline index 22caa170f..4a4edcd9d 100644 --- a/baselines/texttospeech/src/v1/text_to_speech_client.ts.baseline +++ b/baselines/texttospeech/src/v1/text_to_speech_client.ts.baseline @@ -179,7 +179,8 @@ export class TextToSpeechClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/baselines/translate/src/v3beta1/translation_service_client.ts.baseline b/baselines/translate/src/v3beta1/translation_service_client.ts.baseline index 2a15f3bd7..b5debda7b 100644 --- a/baselines/translate/src/v3beta1/translation_service_client.ts.baseline +++ b/baselines/translate/src/v3beta1/translation_service_client.ts.baseline @@ -241,7 +241,8 @@ export class TranslationServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err; diff --git a/templates/typescript_gapic/src/$version/$service_client.ts.njk b/templates/typescript_gapic/src/$version/$service_client.ts.njk index 8644039bf..c89063825 100644 --- a/templates/typescript_gapic/src/$version/$service_client.ts.njk +++ b/templates/typescript_gapic/src/$version/$service_client.ts.njk @@ -302,7 +302,8 @@ export class {{ service.name }}Client { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error|null|undefined) => () => { throw err;