Skip to content

Commit

Permalink
Added some other possible string vals to boolean coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed May 31, 2013
1 parent cfb0059 commit a25e81d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/datatypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,19 @@ datatypes = {
var validated;
switch (typeof val) {
case 'string':
if (val == 'true') {
validated = true;
}
else if (val == 'false') {
validated = false;
switch (val) {
case 'true':
case 't':
case 'yes':
case '1':
validated = true;
break;
case 'false':
case 'f':
case 'no':
case '0':
validated = false;
break;
}
break;
case 'number':
Expand Down

0 comments on commit a25e81d

Please sign in to comment.