Skip to content

Commit

Permalink
fix boolean detect logic
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Glenn Hansen <[email protected]>
  • Loading branch information
travisghansen committed Jun 27, 2023
1 parent e7a49ed commit 3cfba92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.13.2

Released 2023-06-27

- fixed boolean detect logic

# 0.13.1

Released 2023-06-16
Expand Down
5 changes: 5 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3cfba92

Please sign in to comment.