Skip to content

Commit

Permalink
refactor: drop dependency on lodash.merge and update links (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed May 21, 2019
1 parent 2cf569f commit 628eae0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 31 deletions.
1 change: 0 additions & 1 deletion packages/google-cloud-speech/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"dependencies": {
"@google-cloud/common": "^1.0.0",
"google-gax": "^1.0.0",
"lodash.merge": "^4.6.1",
"protobufjs": "^6.8.6",
"pumpify": "^1.5.1",
"stream-events": "^1.0.4",
Expand Down
20 changes: 8 additions & 12 deletions packages/google-cloud-speech/src/v1/speech_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

const gapicConfig = require('./speech_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
const protobuf = require('protobufjs');

Expand Down Expand Up @@ -89,12 +88,9 @@ class SpeechClient {
}

// Load the applicable protos.
const protos = merge(
{},
gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
'google/cloud/speech/v1/cloud_speech.proto'
)
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/cloud/speech/v1/cloud_speech.proto']
);

// Some of the methods on this service provide streaming responses.
Expand Down Expand Up @@ -238,7 +234,7 @@ class SpeechClient {
* This object should have the same structure as [RecognitionAudio]{@link google.cloud.speech.v1.RecognitionAudio}
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details.
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
* @param {function(?Error, ?Object)} [callback]
* The function which will be called with the result of the API call.
*
Expand Down Expand Up @@ -309,13 +305,13 @@ class SpeechClient {
* This object should have the same structure as [RecognitionAudio]{@link google.cloud.speech.v1.RecognitionAudio}
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details.
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
* @param {function(?Error, ?Object)} [callback]
* The function which will be called with the result of the API call.
*
* The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object.
* The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object.
* The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object.
* The promise has a method named "cancel" which cancels the ongoing API call.
*
* @example
Expand Down Expand Up @@ -441,7 +437,7 @@ class SpeechClient {
*
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details.
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
* @returns {Stream}
* An object stream which is both readable and writable. It accepts objects
* representing [StreamingRecognizeRequest]{@link google.cloud.speech.v1.StreamingRecognizeRequest} for write() method, and
Expand Down
20 changes: 8 additions & 12 deletions packages/google-cloud-speech/src/v1p1beta1/speech_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

const gapicConfig = require('./speech_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
const protobuf = require('protobufjs');

Expand Down Expand Up @@ -89,12 +88,9 @@ class SpeechClient {
}

// Load the applicable protos.
const protos = merge(
{},
gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
'google/cloud/speech/v1p1beta1/cloud_speech.proto'
)
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/cloud/speech/v1p1beta1/cloud_speech.proto']
);

// Some of the methods on this service provide streaming responses.
Expand Down Expand Up @@ -238,7 +234,7 @@ class SpeechClient {
* This object should have the same structure as [RecognitionAudio]{@link google.cloud.speech.v1p1beta1.RecognitionAudio}
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details.
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
* @param {function(?Error, ?Object)} [callback]
* The function which will be called with the result of the API call.
*
Expand Down Expand Up @@ -309,13 +305,13 @@ class SpeechClient {
* This object should have the same structure as [RecognitionAudio]{@link google.cloud.speech.v1p1beta1.RecognitionAudio}
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details.
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
* @param {function(?Error, ?Object)} [callback]
* The function which will be called with the result of the API call.
*
* The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object.
* The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object.
* The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object.
* The promise has a method named "cancel" which cancels the ongoing API call.
*
* @example
Expand Down Expand Up @@ -441,7 +437,7 @@ class SpeechClient {
*
* @param {Object} [options]
* Optional parameters. You can override the default settings for this call, e.g, timeout,
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details.
* retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details.
* @returns {Stream}
* An object stream which is both readable and writable. It accepts objects
* representing [StreamingRecognizeRequest]{@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} for write() method, and
Expand Down
12 changes: 6 additions & 6 deletions packages/google-cloud-speech/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"updateTime": "2019-05-17T19:51:54.335921Z",
"updateTime": "2019-05-21T11:25:25.116275Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.19.0",
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
"version": "0.20.0",
"dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744",
"internalRef": "248724297"
"sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160",
"internalRef": "249058354"
}
},
{
"template": {
"name": "node_library",
"origin": "synthtool.gcp",
"version": "2019.4.10"
"version": "2019.5.2"
}
}
],
Expand Down

0 comments on commit 628eae0

Please sign in to comment.