@ -50,7 +50,8 @@
var _config = config;
var _errors = [];
var _regex = {
floats: /^-?\d+(\.\d+)?$/,
// floats: /^-?\d+(\.\d+)?$/,
floats : /^(\s*)(-?)[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/,
empty: /^\s*$/
}
var _state = emptyState();
@ -366,6 +366,36 @@ var tests = [
]
},
{
input: "F1,F2,F3\n2,-2, 2\n 2. ,.2, .2 ",
cases: [
config: { delimiter: ",", header: true, dynamicTyping: true },
expected: {
"results": {
"fields": [
"F1",
"F2",
"F3"
],
"rows": [
"F1": 2,
"F2": -2,
"F3": 2
"F2": .2,
"F3": .2
"errors": []
];