deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

fix(msgpack): encode maps with null prototype

Open sanekb opened this issue 1 year ago • 1 comments

sanekb avatar May 17 '24 15:05 sanekb

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 17 '24 15:05 CLAassistant

Codecov Report

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

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              

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

codecov[bot] avatar May 19 '24 14:05 codecov[bot]

Please run deno fmt.

thanks for remind

sanekb avatar May 19 '24 17:05 sanekb

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

kt3k avatar May 20 '24 12:05 kt3k

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?

sanekb avatar May 20 '24 21:05 sanekb

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 avatar May 20 '24 22:05 iuioiua