Simplify configuration for different environments
This commit is contained in:
@@ -28,6 +28,19 @@ exports.isString = function(data) {
|
||||
return typeof data === 'string' || String.prototype.isPrototypeOf(data);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cast string to a boolean value
|
||||
* @param {} data The input to be checked
|
||||
* @return {boolean} If data is true
|
||||
*/
|
||||
exports.isTrue = function(data) {
|
||||
if (this.isString(data)) {
|
||||
return data === 'true';
|
||||
} else {
|
||||
return !!data;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks for a valid key id which is between 8 and 40 hex chars.
|
||||
* @param {string} data The key id
|
||||
|
||||
Reference in New Issue
Block a user