Skip to content

doc: Documents existing parseCookie behavior#270

Merged
blakeembrey merged 5 commits intojshttp:masterfrom
saripovdenis:fix/parse-undefined-duplicates
May 7, 2026
Merged

doc: Documents existing parseCookie behavior#270
blakeembrey merged 5 commits intojshttp:masterfrom
saripovdenis:fix/parse-undefined-duplicates

Conversation

@saripovdenis
Copy link
Copy Markdown
Contributor

@saripovdenis saripovdenis commented Apr 28, 2026

Summary

Documents existing parseCookie behavior when a custom decode returns undefined.

When decode returns undefined, parseCookie skips that value. If the same cookie name appears later, the later value can be used.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4898ba2) to head (add4def).
⚠️ Report is 25 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #270   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          160       256   +96     
  Branches        69       114   +45     
=========================================
+ Hits           160       256   +96     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blakeembrey
Copy link
Copy Markdown
Member

Thanks for the PR, but this a vague undocumented feature that allows someone to skip a value in favor of a second one. It should have test coverage, would you be interested in adding that instead?

@blakeembrey
Copy link
Copy Markdown
Member

We can also document undefined behavior, I think that's preferable to total correctness and a perf hit in the fast path.

@saripovdenis saripovdenis changed the title fix: keep undefined decoded cookie values doc: Documents existing parseCookie behavior May 2, 2026
@saripovdenis
Copy link
Copy Markdown
Contributor Author

We can also document undefined behavior, I think that's preferable to total correctness and a perf hit in the fast path.

oops, added it back and documented!

Clarify behavior of custom decode functions in README.
Clarify behavior of custom decode functions in comments.
@blakeembrey blakeembrey merged commit bd80829 into jshttp:master May 7, 2026
10 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