adaltas / node-csv-stringify

CSV stringifier implementing the Node.js `stream.Transform` API
https://csv.js.org/stringify/
186 stars 52 forks source link

context.header set while outputting data row #105

Closed jacobq closed 4 years ago

jacobq commented 4 years ago

The docs specify that the context.header field available in cast functions is:

A boolean indicating if the provided value is a part of the header

However, it appears that this value is also true when writing out the first data row. I expected this field to be false whenever writing out data (so, in practice, for during all calls to cast functions). Is this intentional? It seems like a bug to me. Reproduction code here: https://gist.github.com/jacobq/48589927655ccfc771a5e47f064dc41e

wdavidw commented 4 years ago

Thank you, it is now fixed