fixed bugs

This commit is contained in:
huangjx
2022-02-22 18:09:35 +08:00
parent 1123299e5c
commit 1815c4f00c

View File

@@ -187,9 +187,12 @@ const helper = {
helper.message(msg, 20000); helper.message(msg, 20000);
}) })
}, },
str2Boolean: function (string) { str2Boolean: function (str) {
if (typeof str != "string") {
switch (string.toLowerCase().trim()) { return false;
}
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);
} }
} }
} }