Skip to content

Commit

Permalink
Introduce extend() for merging options with default scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuk committed Aug 17, 2016
1 parent 5f4e5d2 commit a9a3ef2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/language/src/v1beta1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
'use strict';

var languageServiceApi = require('./language_service_api');
var extend = require('extend');
var gax = require('google-gax');

function v1beta1(options) {
options = options || {};
if (!('scopes' in options)) {
options.scopes = v1beta1.ALL_SCOPES;
}
options = extend({
scopes: v1beta1.ALL_SCOPES
}, options);
var gaxGrpc = gax.grpc(options);
return languageServiceApi(gaxGrpc);
}
Expand Down
3 changes: 1 addition & 2 deletions packages/language/src/v1beta1/language_service_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function LanguageServiceApi(gaxGrpc, grpcClient, opts) {
var appName = opts.appName || 'gax';
var appVersion = opts.appVersion || gax.Version;


var googleApiClient = [
appName + '/' + appVersion,
CODE_GEN_NAME_VERSION,
Expand Down Expand Up @@ -236,6 +235,6 @@ module.exports = function build(gaxGrpc) {
return new LanguageServiceApi(gaxGrpc, grpcClient, opts);
};
return built;
}
};
module.exports.SERVICE_ADDRESS = SERVICE_ADDRESS;
module.exports.ALL_SCOPES = ALL_SCOPES;

0 comments on commit a9a3ef2

Please sign in to comment.