Skip to content

Commit

Permalink
Fix indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Nov 2, 2017
1 parent 467195a commit 11c885c
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions packages/vision/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,25 @@ var coerceImage = (image, callback) => {
* @return {Function} - The function that, when called, will call annotateImage
* asking for the single feature annotation.
*/
var _createSingleFeatureMethod = featureValue => {
return function(annotateImageRequest, callOptions) {
annotateImageRequest.features = annotateImageRequest.features || [{
type: featureValue,
}];

// If the user submitted explicit features that do not line up with
// the precise method called, throw an exception.
for (let feature of annotateImageRequest.features) {
if (feature.type !== featureValue) {
throw new Error(
'Setting explicit features is not supported on this method. ' +
'Use the #annotateImage method instead.'
);
}
}

// Call the underlying #annotateImage method.
return this.annotateImage(annotateImageRequest, callOptions);
};
};
var _createSingleFeatureMethod = featureValue => {
return function(annotateImageRequest, callOptions) {
annotateImageRequest.features = annotateImageRequest.features || [{
type: featureValue,
}];
// If the user submitted explicit features that do not line up with
// the precise method called, throw an exception.
for (let feature of annotateImageRequest.features) {
if (feature.type !== featureValue) {
throw new Error(
'Setting explicit features is not supported on this method. ' +
'Use the #annotateImage method instead.'
);
}
}
// Call the underlying #annotateImage method.
return this.annotateImage(annotateImageRequest, callOptions);
};
};


/*!
Expand Down

0 comments on commit 11c885c

Please sign in to comment.