Skip to content

Recurse only into plain objects in nano-form-sanitize deep mode - #20

Merged
arnelirobles merged 1 commit into
mainfrom
fix/nano-form-sanitize-plain-objects
Nov 12, 2026
Merged

arnelirobles merged 1 commit into
mainfrom
fix/nano-form-sanitize-plain-objects

Conversation

@arnelirobles

Copy link
Copy Markdown
Contributor

Fixes the plain part of F10. With deep: true, only plain objects are recursed into. File, Blob, Map, Set, URL, Date and class instances are returned as they are, where before they were rebuilt as {} (a form with a file upload lost the file). The files in this package use CRLF line endings, kept as they were.

Not changed, design decisions: array handling under deep and the name "sanitize".

Tests: packages/nano-form-sanitize/src/index.test.ts, new deep mode with non-plain objects block. 2 fail on main, all 26 pass here, tsc clean.

- test: packages/nano-form-sanitize/src/index.test.ts
  breaks: packages/nano-form-sanitize/src/index.ts "if (opts.deep && isPlainObject(value)) {"

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@arnelirobles
arnelirobles marked this pull request as ready for review November 12, 2026 15:34
@arnelirobles
arnelirobles merged commit 803b9b8 into main Nov 12, 2026
2 checks passed
@arnelirobles
arnelirobles deleted the fix/nano-form-sanitize-plain-objects branch November 12, 2026 15:34
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.

1 participant