node-csvtojson icon indicating copy to clipboard operation
node-csvtojson copied to clipboard

fix unused variable prevent string enforcement

Open pubkey opened this issue 5 years ago • 2 comments

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?

pubkey avatar Apr 28 '20 00:04 pubkey

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 Coverage Status
Change from base Build 234: 0.07%
Covered Lines: 664
Relevant Lines: 680

💛 - Coveralls

coveralls avatar Apr 28 '20 00:04 coveralls

Maybe it would be better to directly throw if no string was given

pubkey avatar Apr 28 '20 00:04 pubkey