File tree 4 files changed +17
-26
lines changed
packages/google-cloud-securitycenter
4 files changed +17
-26
lines changed Original file line number Diff line number Diff line change @@ -110,14 +110,11 @@ export class SecurityCenterClient {
110
110
// const showcaseClient = new showcaseClient({ projectId, customConfig });
111
111
opts . clientConfig = opts . clientConfig || { } ;
112
112
113
- const isBrowser = typeof window !== 'undefined' ;
114
- if ( isBrowser ) {
115
- opts . fallback = true ;
116
- }
117
- // If we are in browser, we are already using fallback because of the
118
- // "browser" field in package.json.
119
- // But if we were explicitly requested to use fallback, let's do it now.
120
- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
113
+ // If we're running in browser, it's OK to omit `fallback` since
114
+ // google-gax has `browser` field in its `package.json`.
115
+ // For Electron (which does not respect `browser` field),
116
+ // pass `{fallback: true}` to the SecurityCenterClient constructor.
117
+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
121
118
122
119
// Create a `gaxGrpc` object, with any grpc-specific options
123
120
// sent to the client.
Original file line number Diff line number Diff line change @@ -110,14 +110,11 @@ export class SecurityCenterClient {
110
110
// const showcaseClient = new showcaseClient({ projectId, customConfig });
111
111
opts . clientConfig = opts . clientConfig || { } ;
112
112
113
- const isBrowser = typeof window !== 'undefined' ;
114
- if ( isBrowser ) {
115
- opts . fallback = true ;
116
- }
117
- // If we are in browser, we are already using fallback because of the
118
- // "browser" field in package.json.
119
- // But if we were explicitly requested to use fallback, let's do it now.
120
- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
113
+ // If we're running in browser, it's OK to omit `fallback` since
114
+ // google-gax has `browser` field in its `package.json`.
115
+ // For Electron (which does not respect `browser` field),
116
+ // pass `{fallback: true}` to the SecurityCenterClient constructor.
117
+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
121
118
122
119
// Create a `gaxGrpc` object, with any grpc-specific options
123
120
// sent to the client.
Original file line number Diff line number Diff line change @@ -110,14 +110,11 @@ export class SecurityCenterClient {
110
110
// const showcaseClient = new showcaseClient({ projectId, customConfig });
111
111
opts . clientConfig = opts . clientConfig || { } ;
112
112
113
- const isBrowser = typeof window !== 'undefined' ;
114
- if ( isBrowser ) {
115
- opts . fallback = true ;
116
- }
117
- // If we are in browser, we are already using fallback because of the
118
- // "browser" field in package.json.
119
- // But if we were explicitly requested to use fallback, let's do it now.
120
- this . _gaxModule = ! isBrowser && opts . fallback ? gax . fallback : gax ;
113
+ // If we're running in browser, it's OK to omit `fallback` since
114
+ // google-gax has `browser` field in its `package.json`.
115
+ // For Electron (which does not respect `browser` field),
116
+ // pass `{fallback: true}` to the SecurityCenterClient constructor.
117
+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
121
118
122
119
// Create a `gaxGrpc` object, with any grpc-specific options
123
120
// sent to the client.
Original file line number Diff line number Diff line change 4
4
"git": {
5
5
"name": ".",
6
6
"remote": "https://github.com/googleapis/nodejs-security-center.git",
7
- "sha": "20e4b1e59990902c7d48310fd452d8709d63743c "
7
+ "sha": "41bd2a92dbed2041ef5d5def1b3ce0c22b670b12 "
8
8
}
9
9
},
10
10
{
19
19
"git": {
20
20
"name": "synthtool",
21
21
"remote": "https://github.com/googleapis/synthtool.git",
22
- "sha": "1c92077459db3dc50741e878f98b08c6261181e0 "
22
+ "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469 "
23
23
}
24
24
}
25
25
],
You can’t perform that action at this time.
0 commit comments