@@ -33,7 +33,7 @@ const gax = require('google-gax');
33
33
*
34
34
* @returns An object representing an AnnotateImageRequest.
35
35
*/
36
- let _requestToObject = request => {
36
+ const _requestToObject = request => {
37
37
if ( is . string ( request ) ) {
38
38
// Is this a URL or a local file?
39
39
// Guess based on what the string looks like, and build the full
@@ -62,7 +62,7 @@ let _requestToObject = request => {
62
62
* function.
63
63
* @param {function } callback The callback to run.
64
64
*/
65
- let _coerceRequest = ( request , callback ) => {
65
+ const _coerceRequest = ( request , callback ) => {
66
66
// At this point, request must be an object with an `image` key; if not,
67
67
// it is an error. If there is no image, throw an exception.
68
68
if ( ! is . object ( request ) || is . undefined ( request . image ) ) {
@@ -102,7 +102,7 @@ let _coerceRequest = (request, callback) => {
102
102
* @returns {function } The function that, when called, will call annotateImage
103
103
* asking for the single feature annotation.
104
104
*/
105
- let _createSingleFeatureMethod = featureValue => {
105
+ const _createSingleFeatureMethod = featureValue => {
106
106
return function ( annotateImageRequest , callOptions , callback ) {
107
107
// Sanity check: If we got a string or buffer, we need this to be
108
108
// in object form now, so we can tack on the features list.
@@ -128,7 +128,7 @@ let _createSingleFeatureMethod = featureValue => {
128
128
129
129
// If the user submitted explicit features that do not line up with
130
130
// the precise method called, throw an exception.
131
- for ( let feature of annotateImageRequest . features ) {
131
+ for ( const feature of annotateImageRequest . features ) {
132
132
if ( feature . type !== featureValue ) {
133
133
throw new Error (
134
134
'Setting explicit features is not supported on this method. ' +
@@ -152,7 +152,7 @@ let _createSingleFeatureMethod = featureValue => {
152
152
* onto the pure GAPIC.
153
153
*/
154
154
module . exports = apiVersion => {
155
- let methods = { } ;
155
+ const methods = { } ;
156
156
157
157
/**
158
158
* Annotate a single image with the requested features.
@@ -227,7 +227,7 @@ module.exports = apiVersion => {
227
227
}
228
228
229
229
// Call the GAPIC batch annotation function.
230
- let requests = { requests : [ req ] } ;
230
+ const requests = { requests : [ req ] } ;
231
231
return this . batchAnnotateImages ( requests , callOptions , ( err , r ) => {
232
232
// If there is an error, handle it.
233
233
if ( err ) {
@@ -236,7 +236,7 @@ module.exports = apiVersion => {
236
236
237
237
// We are guaranteed to only have one response element, since we
238
238
// only sent one image.
239
- let response = r . responses [ 0 ] ;
239
+ const response = r . responses [ 0 ] ;
240
240
241
241
// Fire the callback if applicable.
242
242
return callback ( undefined , response ) ;
0 commit comments