I'm looking at an old version but seems current code has the same issue.
parseFloat('01111') === 1111
"01111" is not a number, but is instead a string.
|
function numberType(item) { |
|
var rtn = parseFloat(item); |
|
if (isNaN(rtn)) { |
|
return item; |
|
} |
|
return rtn; |
|
} |
Unfortunately isFinite('01111') === true also otherwise it may be a solution.
You may need a Regex based approach.
I'm looking at an old version but seems current code has the same issue.
parseFloat('01111') === 1111"01111"is not a number, but is instead a string.node-csvtojson/src/lineToJson.ts
Lines 162 to 168 in 89a9a36
Unfortunately
isFinite('01111') === truealso otherwise it may be a solution.You may need a Regex based approach.