fixed bugs
This commit is contained in:
@@ -187,9 +187,12 @@ const helper = {
|
|||||||
helper.message(msg, 20000);
|
helper.message(msg, 20000);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
str2Boolean: function (string) {
|
str2Boolean: function (str) {
|
||||||
|
if (typeof str != "string") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (string.toLowerCase().trim()) {
|
switch (str.toLowerCase().trim()) {
|
||||||
case "true":
|
case "true":
|
||||||
case "yes":
|
case "yes":
|
||||||
case "1":
|
case "1":
|
||||||
@@ -201,7 +204,7 @@ const helper = {
|
|||||||
case null:
|
case null:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
return Boolean(string);
|
return Boolean(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user