Simplify configuration for different environments

This commit is contained in:
Tankred Hase
2016-06-07 14:56:55 +02:00
parent 2ab6333a15
commit 2acbffa2f2
18 changed files with 94 additions and 158 deletions

View File

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