File tree Expand file tree Collapse file tree
packages/google-privacy-dlp/src/v2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import * as path from 'path';
3131import { Transform } from 'stream' ;
3232import { RequestType } from 'google-gax/build/src/apitypes' ;
3333import * as protos from '../../protos/protos' ;
34+ import jsonProtos = require( '../../protos/protos.json' ) ;
3435/**
3536 * Client JSON configuration object, loaded from
3637 * `src/v2/dlp_service_client_config.json`.
@@ -153,22 +154,7 @@ export class DlpServiceClient {
153154 clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
154155 }
155156 // Load the applicable protos.
156- // For Node.js, pass the path to JSON proto file.
157- // For browsers, pass the JSON content.
158-
159- const nodejsProtoPath = path . join (
160- __dirname ,
161- '..' ,
162- '..' ,
163- 'protos' ,
164- 'protos.json'
165- ) ;
166- this . _protos = this . _gaxGrpc . loadProto (
167- opts . fallback
168- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
169- require ( '../../protos/protos.json' )
170- : nodejsProtoPath
171- ) ;
157+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
172158
173159 // This API contains "path templates"; forward-slash-separated
174160 // identifiers to uniquely identify resources within the API.
You can’t perform that action at this time.
0 commit comments