Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
fix: use optional chaining for window.fetch feature detection
Browse files Browse the repository at this point in the history
Use gapic-generator-typescript v1.2.4.
Committer: @alexander-fenster
PiperOrigin-RevId: 343136730

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Nov 18 12:49:25 2020 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 2cda8d285b66c14da57363201b7e4efbca47d034
Source-Link: googleapis/googleapis@2cda8d2
  • Loading branch information
yoshi-automation committed Nov 19, 2020
1 parent c3147d8 commit 89755a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/v1beta/game_server_clusters_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ export class GameServerClustersServiceClient {
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
// eslint-disable-next-line no-undef
const fallback =
opts?.fallback ??
(typeof window !== 'undefined' && typeof window.fetch !== 'undefined');
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
Expand Down
3 changes: 1 addition & 2 deletions src/v1beta/game_server_configs_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ export class GameServerConfigsServiceClient {
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
// eslint-disable-next-line no-undef
const fallback =
opts?.fallback ??
(typeof window !== 'undefined' && typeof window.fetch !== 'undefined');
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
Expand Down
3 changes: 1 addition & 2 deletions src/v1beta/game_server_deployments_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ export class GameServerDeploymentsServiceClient {
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
// eslint-disable-next-line no-undef
const fallback =
opts?.fallback ??
(typeof window !== 'undefined' && typeof window.fetch !== 'undefined');
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
Expand Down
3 changes: 1 addition & 2 deletions src/v1beta/realms_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ export class RealmsServiceClient {
opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
const port = opts?.port || staticMembers.port;
const clientConfig = opts?.clientConfig ?? {};
// eslint-disable-next-line no-undef
const fallback =
opts?.fallback ??
(typeof window !== 'undefined' && typeof window.fetch !== 'undefined');
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
Expand Down

0 comments on commit 89755a8

Please sign in to comment.