diff --git a/papaparse.js b/papaparse.js index dd892e59..1000a3c7 100644 --- a/papaparse.js +++ b/papaparse.js @@ -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); diff --git a/tests/test-cases.js b/tests/test-cases.js index 66147a0a..524f9918 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -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: [] } }, diff --git a/tests/test-runner.js b/tests/test-runner.js index 8a3dd94a..0b1cdd47 100644 --- a/tests/test-runner.js +++ b/tests/test-runner.js @@ -178,7 +178,7 @@ function compare(actualData, actualErrors, expected) return { data: data, errors: errors - } + }; function compareData(actual, expected)