From 3cfba922c1623485b09c8ade4ef8206265113ed2 Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Tue, 27 Jun 2023 08:03:15 -0600 Subject: [PATCH] fix boolean detect logic Signed-off-by: Travis Glenn Hansen --- CHANGELOG.md | 6 ++++++ src/utils.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c31177..52d5aea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.13.2 + +Released 2023-06-27 + +- fixed boolean detect logic + # 0.13.1 Released 2023-06-16 diff --git a/src/utils.js b/src/utils.js index efae428..ab62e1b 100644 --- a/src/utils.js +++ b/src/utils.js @@ -126,6 +126,11 @@ function generate_csrf_id() { function toBoolean(input) { //return !!(dataStr?.toLowerCase?.() === 'true' || dataStr === true || Number.parseInt(dataStr, 10) === 0); //return !!(dataStr?.toLowerCase?.() === 'true' || dataStr === true); + + if (typeof input == "undefined" || input === null) { + return false; + } + if (typeof input == "boolean") { return input; }