{"ScriptPreparationCode":"function toBoolean(anyVal,defaultVal)\r\n{\r\n let bool = defaultVal || false;\r\n\r\n if (typeof anyVal === \u0027boolean\u0027)\r\n {\r\n bool = anyVal;\r\n } else if (typeof anyVal !== \u0027undefined\u0027)\r\n {\r\n bool = ((\u0060${anyVal}\u0060).toLowerCase() === \u0027true\u0027);\r\n }\r\n\r\n return bool;\r\n}\r\n\r\n\r\nfunction toBool(stringVal, defaultVal) {\r\n if (stringVal === undefined)\r\n {\r\n return Boolean(defaultVal);\r\n }\r\n const strFalseValues = [\u00270\u0027, \u0027false\u0027, \u0027no\u0027].concat([]);\r\n if (typeof stringVal === \u0027string\u0027)\r\n {\r\n return (strFalseValues.indexOf(stringVal.toLowerCase().trim()) === -1);\r\n }\r\n // value is likely null, boolean, or number\r\n return Boolean(stringVal);\r\n }","TestCases":[{"Name":"toBoolean","Code":"toBoolean(\u0022true\u0022,true)","IsDeferred":false},{"Name":"toBool","Code":"toBool(\u0022true\u0022,true)","IsDeferred":false}]}