maxogden/csv-write-stream — pull request #14 by finnp (2014-11-12 01:14:41+00:00)
Title: handle arrays without errors

Hey,

I just took some time to actually understand to how the module works...

And the problem I was having in #13 was quite simply due to arrays as values. What happened whas that the `'(/['+sep+'\\r\\n"]/.test('+prop+')` part always was true on the implicit to string conversion of array properties (since `[1,2].toString()` contains a comma :D).

Just turning the property to a string solves it and doesn't seem to add time to the benchmark on my computer (`+""` seems to be faster the `.toString()`)

I also added a test for it. It would probably also be cool to add a `jsonMode`, which would actually stringify those array and object properties correctly.

Best,
Finn