Changed ParseBoolean functionality to allow for undefined and null
This commit is contained in:
1 parent
f2fc5bd984
commit
15b7383c61
1 file changed
+7
-1
@@ -6,8 +6,14 @@
|
|||||||
const ParseBoolean = (value) => {
|
const ParseBoolean = (value) => {
|
||||||
if (value === true || value === "true") {
|
if (value === true || value === "true") {
|
||||||
return true;
|
return true;
|
||||||
|
} else if (
|
||||||
|
value === false ||
|
||||||
|
value === "false" ||
|
||||||
|
value === null ||
|
||||||
|
value === undefined
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
Reference in new issue
Block a user