|
21 | 21 | * any required setup. |
22 | 22 | */ |
23 | 23 |
|
24 | | -// Load the Underscore.js library. This library was added using the script |
25 | | -// ID "1I21uLOwDKdyF3_W_hvh6WXiIKWJWno8yG9lB8lf1VBnZFQ6jAAhyNTRG". |
26 | | - |
27 | | - |
28 | 24 | /** |
29 | 25 | * The supported formats for the returned OAuth2 token. |
30 | 26 | * @enum {string} |
@@ -264,7 +260,7 @@ Service_.prototype.setCache = function(cache) { |
264 | 260 | */ |
265 | 261 | Service_.prototype.setScope = function(scope, opt_separator) { |
266 | 262 | var separator = opt_separator || ' '; |
267 | | - this.params_.scope = _.isArray(scope) ? scope.join(separator) : scope; |
| 263 | + this.params_.scope = Array.isArray(scope) ? scope.join(separator) : scope; |
268 | 264 | return this; |
269 | 265 | }; |
270 | 266 |
|
@@ -766,24 +762,12 @@ function buildUrl_(url, params) { |
766 | 762 | function validate_(params) { |
767 | 763 | Object.keys(params).forEach(function(name) { |
768 | 764 | var value = params[name]; |
769 | | - if (isEmpty_(value)) { |
| 765 | + if (!value) { |
770 | 766 | throw Utilities.formatString('%s is required.', name); |
771 | 767 | } |
772 | 768 | }); |
773 | 769 | } |
774 | 770 |
|
775 | | -/** |
776 | | - * Returns true if the given value is empty, false otherwise. An empty value is one of |
777 | | - * null, undefined, a zero-length string, a zero-length array or an object with no keys. |
778 | | - * @param {?} value The value to test. |
779 | | - * @returns {boolean} True if the value is empty, false otherwise. |
780 | | - * @private |
781 | | - */ |
782 | | -function isEmpty_(value) { |
783 | | - return value === null || value === undefined || |
784 | | - ((_.isObject(value) || _.isString(value)) && _.isEmpty(value)); |
785 | | -} |
786 | | - |
787 | 771 | /** |
788 | 772 | * Gets the time in seconds, rounded down to the nearest second. |
789 | 773 | * @param {Date} date The Date object to convert. |
|
0 commit comments