pablocortez / jquery-csv

Automatically exported from code.google.com/p/jquery-csv
MIT License
0 stars 0 forks source link

Options arg not really optional? #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Pass a two arg call to $.csv.toObjects(csvData, callback)
2.
3.

What is the expected output? What do you see instead?
Callback is is not invoked. If an empty object is passed as second arg:

$.csv.toObjects(csvData, {}, callback)

then the callback is invoked.

What version of the product are you using? On what operating system?
0.71

Please provide any additional information below.
Maybe its just my understanding of optional args .... if both "optional" args 
need to be present, maybe the docs need amending? 

Original issue reported on code.google.com by joe.falc...@gmail.com on 15 Feb 2015 at 4:39

GoogleCodeExporter commented 9 years ago
You're correct.

This issue hasn't come up yet because using jquery-csv in node.js is not the 
usual use case.

This can most likely be fixed by applying explicit type checking when only 2 
arguments are present. I'll look into it.

Original comment by evanpla...@gmail.com on 15 Feb 2015 at 4:49

GoogleCodeExporter commented 9 years ago
It me some time to work out what was going on since it didn't throw any
error.

Might be worth changing the docs if the code can't be fixed in short term.

Joe

Original comment by joe.falc...@gmail.com on 22 Feb 2015 at 2:53