Skip to content

Commit f75c066

Browse files
author
Eric Koleda
authored
Merge pull request #100 from grant/master
Removes Underscore dependency
2 parents aad4b23 + 76743d8 commit f75c066

File tree

14 files changed

+68
-1629
lines changed

14 files changed

+68
-1629
lines changed

dist/OAuth2.gs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
* any required setup.
2222
*/
2323

24-
// Load the Underscore.js library. This library was added using the script
25-
// ID "1I21uLOwDKdyF3_W_hvh6WXiIKWJWno8yG9lB8lf1VBnZFQ6jAAhyNTRG".
26-
27-
2824
/**
2925
* The supported formats for the returned OAuth2 token.
3026
* @enum {string}
@@ -264,7 +260,7 @@ Service_.prototype.setCache = function(cache) {
264260
*/
265261
Service_.prototype.setScope = function(scope, opt_separator) {
266262
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;
268264
return this;
269265
};
270266

@@ -766,24 +762,12 @@ function buildUrl_(url, params) {
766762
function validate_(params) {
767763
Object.keys(params).forEach(function(name) {
768764
var value = params[name];
769-
if (isEmpty_(value)) {
765+
if (!value) {
770766
throw Utilities.formatString('%s is required.', name);
771767
}
772768
});
773769
}
774770

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-
787771
/**
788772
* Gets the time in seconds, rounded down to the nearest second.
789773
* @param {Date} date The Date object to convert.

0 commit comments

Comments
 (0)