]> git.ardis.lu - csvio/commit
Ignore `handleHeaders` if the row has been normalized
authorArdis Lu <ardisglu@gmail.com>
Thu, 10 Jul 2025 05:10:20 +0000 (22:10 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 10 Jul 2025 05:10:20 +0000 (22:10 -0700)
commit1a67489b9e9e17119d91a82ee388c5550eeb4fb4
tree255bd56f19e6c5c241285f6eea9ed69575b376e6
parentabd24a42b84e22670b2f75d380438e8feee5fa14
Ignore `handleHeaders` if the row has been normalized

This behavior is desirable when `CSVTransformer` interacts with `CSVNormalizer` or any other transformation which converts the row from `Array<string>` into `Array<Object>`, because it avoids the need to pass `handleHeaders: true` to `CSVTransformer` (which is counterintuitive). It is more accurate to say the header row has been deleted by the transformation and must by re-inserted into the write stream later.

The loosening of the type checking is not a breaking change. Since the row is passed directly to `JSON.parse()`, the fields could have always been type `Object` instead of `string`.
src/core.js
test/core.test.js
test/normalization.test.js
This page took 0.035452 seconds and 4 git commands to generate.