Skip to content

Commit

Permalink
change boolean behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
beatak committed Oct 29, 2011
1 parent 1a620f3 commit a5010ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/typecast.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ TypeCast.Boolean = function (arg) {
result = false;
}
else {
result = !(arg === 'false');
if (arg === 'false' || arg === '0' || arg === 'undefined' || arg === 'null') {
result = false;
}
else {
result = true;
}
}
break;
case (t === 'undefined'):
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Takashi Mizohata <beatak@gmail.com> (http://beatak.github.com/)",
"name": "TypeCast",
"description": "more intuitive type cast functions for JavaScript",
"version": "0.0.2",
"version": "0.0.3",
"homepage": "https://github.com/beatak/TypeCast/",
"repository": {
"type": "git",
Expand Down

0 comments on commit a5010ba

Please sign in to comment.