Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discernParser is documented incorrectly #67

Closed
aubergene opened this issue Oct 2, 2017 · 7 comments
Closed

discernParser is documented incorrectly #67

aubergene opened this issue Oct 2, 2017 · 7 comments

Comments

@aubergene
Copy link
Contributor

I was expecting to be able to do this

var parser = io.discernParser('blah.csv')
parser('name,price\nApple,1513\nPear,300')
@mhkeller
Copy link
Owner

mhkeller commented Oct 2, 2017

Ya that's a good catch. It's documented correctly as returning a function that takes a file path but this would make more sense to rename and then separately create functions that expose the parser.

@aubergene
Copy link
Contributor Author

Yeah, I think it would be good, then it easy to use it in situations where you've read the file by some other mechanism already.

@aubergene
Copy link
Contributor Author

Wait, it's actually correct, it does return a parser, and works exactly I wanted, so it's just documented incorrectly, hoorah!

@aubergene aubergene changed the title discernParser returns a reader not a parser discernParser is documented incorrectly Oct 3, 2017
@mhkeller
Copy link
Owner

mhkeller commented Oct 3, 2017 via email

@mhkeller
Copy link
Owner

mhkeller commented Oct 3, 2017

FYI i think the usage of this function is a bit bonkers since it has these weird two optional arguments whether it's a file path or a delimiter. I was planning on refactoring it later on when times seem worthy of a breaking change. Something like a first argument as a string and on option options object with delimter: true if that string should be treated as a delimiter

io.discernParser(strToTest[,{delimier: true}])

Issue: #63

@mhkeller
Copy link
Owner

mhkeller commented Oct 4, 2017

This is fixed via 2c4ec09

@mhkeller
Copy link
Owner

Published in 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants