Skip to content

Conversation

@kricsleo
Copy link
Member

resolves #282

@codecov
Copy link

codecov bot commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.60%. Comparing base (d283cf5) to head (0457caf).
Report is 80 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #286      +/-   ##
==========================================
+ Coverage   95.27%   97.60%   +2.33%     
==========================================
  Files           7        7              
  Lines         867      711     -156     
  Branches      187      240      +53     
==========================================
- Hits          826      694     -132     
+ Misses         41       17      -24     

☔ 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.

@pi0
Copy link
Member

pi0 commented Apr 3, 2025

We need to use an object with null proto.

@kricsleo kricsleo changed the title fix: use hasOwnProperty for key existence check fix: use object with null prototype to avoid merging prototype properties Apr 4, 2025
@kricsleo
Copy link
Member Author

kricsleo commented Apr 4, 2025

We need to use an object with null proto.

@pi0 This object will be returned for the user to use, and they may expect it to behave like a normal object with prototype functions (e.g., calling .toString() for their own purposes). A "null proto" would break their code.

If this object is only for internal use, that's fine since we control how it's used. But if it's exposed to users, are you still okay with that? 🤔

@pi0
Copy link
Member

pi0 commented Apr 4, 2025

It wouldn't break user expectations, and using null proto objects is pretty standard way to help this issue.

@pi0 pi0 changed the title fix: use object with null prototype to avoid merging prototype properties fix(parseQuery): use object with null prototype Apr 7, 2025
@pi0 pi0 merged commit 4d024df into unjs:main Apr 7, 2025
2 checks passed
@pi0
Copy link
Member

pi0 commented Apr 7, 2025

Thanks 🙏🏼

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.

Usage of default-prototype Object for URL params results in parsing problems

3 participants