Closed random42 closed 4 years ago
Please provide a complete example on how you are using the library.
By the way, this is not JSON, it is just a JS object literal. JSON is a string.
Please provide a complete example on how you are using the library.
I edited the issue so you can try it yourself.
By the way, this is not JSON, it is just a JS object literal. JSON is a string.
What I meant is that when serializing an object column to csv the library converts it into JSON.
This library is about generating CSV, which is tabular and not hierarchical. When it encounters an object literal, the default is to serialise to JSON because there is not much else we can do. Of course, this JSON is a field of our final CSV and must be escaped to produce valid CSV. I don't see anything wrong with your code provided above.
My fault, sorry. I thought it was only a matter of escaping the separator character with something like \
I still don't understand how that escaping works but csv parsers get it somehow, so that's enough.
I'm using version 5.3.6, but tried also on 5.5.1
When serializing an object the JSON output is incorrect:
Output:
Even when option
quoted
is false (by default). Even when passingJSON.stringify
ascast.object
option, same result.