Skip to content

Commit

Permalink
Dynamic typing converts "TRUE" and "FALSE" to boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Feb 23, 2015
1 parent 347befd commit 4efe5b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions papaparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,9 @@
if (_config.dynamicTyping)
{
var value = _results.data[i][j];
if (value == "true")
if (value == "true" || value == "TRUE")
_results.data[i][j] = true;
else if (value == "false")
else if (value == "false" || value == "FALSE")
_results.data[i][j] = false;
else
_results.data[i][j] = tryParseFloat(value);
Expand Down
4 changes: 2 additions & 2 deletions tests/test-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,10 @@ var PARSE_TESTS = [
},
{
description: "Dynamic typing converts boolean literals",
input: 'true,false,T,F,TRUE,False',
input: 'true,false,T,F,TRUE,FALSE,True,False',
config: { dynamicTyping: true },
expected: {
data: [[true, false, "T", "F", "TRUE", "False"]],
data: [[true, false, "T", "F", true, false, "True", "False"]],
errors: []
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function compare(actualData, actualErrors, expected)
return {
data: data,
errors: errors
}
};


function compareData(actual, expected)
Expand Down

0 comments on commit 4efe5b6

Please sign in to comment.