Skip to content

fix(csv-stringify): preserve caller cast configuration - #533

Merged
wdavidw merged 2 commits into
adaltas:masterfrom
sricharanreddycheruku:new/preserve-cast-configuration
Oct 13, 2026
Merged

wdavidw merged 2 commits into
adaltas:masterfrom
sricharanreddycheruku:new/preserve-cast-configuration

Conversation

@sricharanreddycheruku

@sricharanreddycheruku sricharanreddycheruku commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

A frozen cast configuration fails when normalization writes default callbacks into it. Copy the configuration before filling defaults, so a caller can reuse the same frozen object.

The TypeScript regression uses should.js, runs the synchronous API twice and verifies that the original configuration is unchanged.

Local validation on Ubuntu, Node 24.19.0:

  • Complete csv-stringify tests and TypeScript check: 233 passing, one existing pending test.
  • The new frozen-configuration test fails against unchanged production code and passes after the fix.
  • Package build passes. Lint has no errors and one existing pending-test warning.
  • Formatting, normal commit hooks and git diff --check pass.

The preceding workspace run hit an unchanged csv-parse test expecting "an boolean" while the source now says "a boolean". That failure was reproduced on the unchanged parser. This contribution leaves that package unchanged. Other Node versions and browser runtime checks were not run locally.

Comment thread packages/csv-stringify/lib/api/normalize_options.js Outdated
Comment thread packages/csv-stringify/test/option.cast.js Outdated
Comment thread packages/csv-stringify/lib/api/normalize_options.js Outdated
Comment thread packages/csv-stringify/test/option.cast.js Outdated
Comment thread packages/csv-stringify/test/option.cast.js Outdated
Comment thread packages/csv-stringify/test/option.cast.js Outdated
Comment thread packages/csv-stringify/test/option.cast.js Outdated
@wdavidw
wdavidw merged commit f12e686 into adaltas:master Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants