Skip to content

Conversation

@mrodrig
Copy link
Owner

@mrodrig mrodrig commented Mar 23, 2019

Background Information

I have...

  • added at least one test to verify the failure condition is fixed.
  • verified the tests are passing.

mrodrig added 4 commits March 20, 2019 21:49
In #109, it was noted that if the final value of the CSV record was empty, then the JSON object's value for that final column would be ',' which was incorrect. This fixes that by checking if the field is empty and conditionally pushes an appropriate value.
…mplied trailing value.

* Since there's an implied trailing value if the last character in a line is a comma, we need to append an additional empty value to the splitLine array. Without that additional empty value, the splitLine array is essentially missing the data for the last value in the line since the line parser was previously not taking into account the implied trailing empty value.

#109
* When the last character is a field delimiter, the code was capturing that delimiter value in the second to last value. This adjusts the code such that the field delimiter will not be captured in the second to last value. This issue was discovered while testing the fixes for #109.
@mrodrig mrodrig added this to the 3.4.2 milestone Mar 23, 2019
@mrodrig mrodrig changed the title Fix 109 Fix #109 Mar 23, 2019
@mrodrig mrodrig added bug csv2json CSV to JSON labels Mar 23, 2019
@mrodrig mrodrig merged commit 02336b8 into master Mar 23, 2019
@mrodrig mrodrig deleted the fix-109 branch March 23, 2019 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug csv2json CSV to JSON

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants