This commit is contained in:
2019-12-11 19:43:20 +00:00
parent 2cf2b03599
commit 79a84eba42
12 changed files with 107 additions and 21 deletions

View File

@@ -99,6 +99,25 @@ export default {
hash |= 0; // Convert to 32bit integer
}
return hash;
},
///////////////////////////////
// CONVERT STRING TO BOOLEAN
// https://stackoverflow.com/a/1414175/8939
//
stringToBoolean: function(string) {
switch (string.toLowerCase().trim()) {
case "true":
case "yes":
case "1":
return true;
case "false":
case "no":
case "0":
case null:
return false;
default:
return Boolean(string);
}
}
//new functions above here