ufo icon indicating copy to clipboard operation
ufo copied to clipboard

fix: use `hasOwnProperty` for key existence check

Open kricsleo opened this issue 9 months ago • 1 comments

resolves #282

kricsleo avatar Mar 30 '25 07:03 kricsleo

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Mar 30 '25 07:03 codecov[bot]

We need to use an object with null proto.

pi0 avatar Apr 03 '25 16:04 pi0

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? 🤔

kricsleo avatar Apr 04 '25 02:04 kricsleo

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

pi0 avatar Apr 04 '25 08:04 pi0

Thanks 🙏🏼

pi0 avatar Apr 07 '25 14:04 pi0