Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(msgpack): encode maps with null prototype #4764

Merged
merged 3 commits into from
May 20, 2024

Conversation

sanekb
Copy link
Contributor

@sanekb sanekb commented May 17, 2024

No description provided.

@sanekb sanekb requested a review from kt3k as a code owner May 17, 2024 15:31
@CLAassistant
Copy link

CLAassistant commented May 17, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

codecov bot commented May 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.88%. Comparing base (377043c) to head (5d0c608).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4764      +/-   ##
==========================================
- Coverage   91.89%   91.88%   -0.01%     
==========================================
  Files         485      485              
  Lines       41308    41315       +7     
  Branches     5317     5320       +3     
==========================================
+ Hits        37959    37964       +5     
- Misses       3292     3294       +2     
  Partials       57       57              

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

Copy link
Collaborator

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run deno fmt.

@sanekb
Copy link
Contributor Author

sanekb commented May 19, 2024

Please run deno fmt.

thanks for remind

@sanekb sanekb requested a review from iuioiua May 19, 2024 17:04
Copy link
Collaborator

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some context behind why this change is needed? Is there a related issue?

msgpack/encode.ts Outdated Show resolved Hide resolved
@kt3k
Copy link
Member

kt3k commented May 20, 2024

This 'is-plain-object' check seems mostly aligned with the implementation of npm:is-plain-obj@2.1.0 https://github.com/sindresorhus/is-plain-obj/blob/v2.1.0/index.js and looks reasonable to me.

@sanekb
Copy link
Contributor Author

sanekb commented May 20, 2024

Is there a related issue?

it is not related to existed issue

  1. but in my case, objects are validated using jsr:@oxi/schema and then piped to the encode(), which throws an error because the validated objects are recreated by calling Object.create(null)
  2. logically, objects without a prototype are the most "plain", isn't it?

@iuioiua
Copy link
Collaborator

iuioiua commented May 20, 2024

Is there a related issue?

it is not related to existed issue

  1. but in my case, objects are validated using jsr:@oxi/schema and then piped to the encode(), which throws an error because the validated objects are recreated by calling Object.create(null)
  2. logically, objects without a prototype are the most "plain", isn't it?

Fair justifications. For future reference, please be sure to include some context in the initial comment for PRs 🙂

@iuioiua iuioiua merged commit 52116b2 into denoland:main May 20, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants