Skip to content

Commit

Permalink
refactor: drop dependency on lodash.merge and update links (#384)
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 efee24b commit 31c2308
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 160 deletions.
1 change: 0 additions & 1 deletion packages/google-cloud-vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"@google-cloud/promisify": "^1.0.0",
"google-gax": "^1.0.0",
"is": "^3.2.1",
"lodash.merge": "^4.6.1",
"protobufjs": "^6.8.6"
},
"devDependencies": {
Expand Down
26 changes: 11 additions & 15 deletions packages/google-cloud-vision/src/v1/image_annotator_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

const gapicConfig = require('./image_annotator_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 @@ -91,12 +90,9 @@ class ImageAnnotatorClient {
}

// Load the applicable protos.
const protos = merge(
{},
gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
'google/cloud/vision/v1/image_annotator.proto'
)
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/cloud/vision/v1/image_annotator.proto']
);
let protoFilesRoot = new gax.GoogleProtoFilesRoot();
protoFilesRoot = protobuf.loadSync(
Expand Down Expand Up @@ -248,7 +244,7 @@ class ImageAnnotatorClient {
* This object should have the same structure as [AnnotateImageRequest]{@link google.cloud.vision.v1.AnnotateImageRequest}
* @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 @@ -303,7 +299,7 @@ class ImageAnnotatorClient {
* This object should have the same structure as [AnnotateFileRequest]{@link google.cloud.vision.v1.AnnotateFileRequest}
* @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 @@ -363,13 +359,13 @@ class ImageAnnotatorClient {
* This object should have the same structure as [OutputConfig]{@link google.cloud.vision.v1.OutputConfig}
* @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 @@ -479,13 +475,13 @@ class ImageAnnotatorClient {
* This object should have the same structure as [AsyncAnnotateFileRequest]{@link google.cloud.vision.v1.AsyncAnnotateFileRequest}
* @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
Loading

0 comments on commit 31c2308

Please sign in to comment.