Skip to content

fix(csv-stringify): preserve objects returned by cast functions - #509

Merged
wdavidw merged 2 commits into
adaltas:masterfrom
agammann:fix-stringify-cast-result-mutation
Sep 21, 2026
Merged

wdavidw merged 2 commits into
adaltas:masterfrom
agammann:fix-stringify-cast-result-mutation

Conversation

@agammann

Copy link
Copy Markdown
Contributor

When a custom cast function returns the same { value, quoted } object for multiple fields, the first field deletes its value property. Subsequent fields become empty. For example, two fields cast to the same quoted "shared" value produce only one populated field.

Copy the cast result before extracting and deleting the local value option. Add regression coverage for reusing a result and for returning a frozen result.

Validation on Node.js 24.19.0:

  • The reused-result regression fails before the fix.
  • On Linux, the csv-stringify TypeScript check and complete Mocha test glob pass: 211 passing, 1 pending.
  • ESLint passes for both changed files.

@wdavidw
wdavidw merged commit 1742c9f into adaltas:master Sep 21, 2026
5 checks passed
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