This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user