googleapis
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -51,7 +51,10 @@ /** | ||
/** | ||
* Returns true if request requires a parameter. | ||
* Returns true if given params contains a query parameter key. | ||
* If no metadata is known about the request's method, true is returned. | ||
* | ||
* @param {object} params The parameters object. | ||
* @return {boolean} Returns whether a parameter is required or not. | ||
*/ | ||
BaseRequest.prototype.doesRequireParams = function() { | ||
BaseRequest.prototype.containsQueryParams = function(params) { | ||
params = params || {}; | ||
if (!this.methodMeta) { | ||
@@ -64,3 +67,4 @@ // we dont know much about the method, dont speculate | ||
for (var paramName in parameters) { | ||
if (parameters[paramName].required) { | ||
if (parameters[paramName].location == 'query' && | ||
params[paramName]) { | ||
return true; | ||
@@ -129,3 +133,4 @@ } | ||
if (!this.doesRequireParams() && !opt_body) { | ||
// move params to | ||
if (!this.containsQueryParams(opt_params) && !opt_body) { | ||
this.params = {}; | ||
@@ -132,0 +137,0 @@ this.body = opt_params; |
{ | ||
"name": "googleapis", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"author": "Google Inc.", | ||
@@ -5,0 +5,0 @@ "description": "Google APIs Client Library for Node.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53807
1161