mirror of
https://github.com/HackPlan/google-auth-library-nodejs.git
synced 2026-04-28 19:55:40 +08:00
Minor cleanup
- corrects comments - removes unnecessary 'var that = this'
This commit is contained in:
@@ -71,20 +71,18 @@ JWT.prototype.createScoped = function(scopes) {
|
||||
/**
|
||||
* Indicates whether the credential requires scopes to be created by calling createdScoped before
|
||||
* use.
|
||||
* @return {object} The cloned instance.
|
||||
* @return {boolean} false if createScoped does not need to be called.
|
||||
*/
|
||||
JWT.prototype.createScopedRequired = function() {
|
||||
var that = this;
|
||||
|
||||
// If scopes is null, always return true.
|
||||
if (that.scopes) {
|
||||
if (this.scopes) {
|
||||
// For arrays, check the array length.
|
||||
if (that.scopes instanceof Array) {
|
||||
return that.scopes.length === 0;
|
||||
if (this.scopes instanceof Array) {
|
||||
return this.scopes.length === 0;
|
||||
}
|
||||
|
||||
// For others, convert to a string and check the length.
|
||||
return String(that.scopes).length === 0;
|
||||
return String(this.scopes).length === 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user