Minor cleanup

- corrects comments
- removes unnecessary 'var that = this'
This commit is contained in:
Tim Emiola
2015-04-21 07:53:14 -07:00
parent f67be507d9
commit 06f0d09344

View File

@@ -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;