]> git.ardis.lu - csvio/commit
Remove intermediate JSON serialization and `rawInput`/`rawOutput` options
authorArdis Lu <ardisglu@gmail.com>
Mon, 4 Aug 2025 06:06:34 +0000 (23:06 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 4 Aug 2025 06:06:34 +0000 (23:06 -0700)
commit81c11c17ebcb6d01cca152d578997567eef5a556
tree1c6b8c430f59eb63eba0c5d182f63e809728c37d
parent50e6fb7f40206d5960c5cddd22f0701e7cfe3879
Remove intermediate JSON serialization and `rawInput`/`rawOutput` options

Previously, each row was JSON serialized and deserialized on each `.pipeThrough`. The intent of this serialization was to normalize the data of each row, with an escape hatch in the `rawInput` and `rawOutput` options.

However, this approach is counterintuitive because most users would expect a CSV row to simply be an `Array<string>`, NOT a `string` that can be `JSON.parse`-ed into an `Array<string>`. Furthermore, this excessive serialization has a significant performance impact. Lastly, the `rawInput` and `rawOutput` options effectively made `CSVTransformer` an overly complex and difficult-to-use JSON parser on top of a CSV transformer.

So, simply removing the JSON serialization and directly enqueuing the actual object (i.e., the `Array<string>`) resolves all these issues with minimal impact to the user-facing API.
README.md
examples/ex1_3.js
src/core.js
src/index.js
src/normalization.js
test/core.test.js
test/large.test.js
test/utils.js
This page took 0.041269 seconds and 4 git commands to generate.