node-csvtojson
node-csvtojson copied to clipboard
fix unused variable prevent string enforcement
There was the call const csv = csvString.toString(); which enforces the input of fromString() to be a string. But the variable csv was never used which is why I got the error csvString.substr is not a function deep in a subdependency.
I changed the code to actually use the string enforcement in the later calls.
What do you think about adding a tslint to the CI to prevent these kind of bugs in the future?
Pull Request Test Coverage Report for Build 235
- 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+0.07%) to 95.421%
| Totals | |
|---|---|
| Change from base Build 234: | 0.07% |
| Covered Lines: | 664 |
| Relevant Lines: | 680 |
💛 - Coveralls
Maybe it would be better to directly throw if no string was given