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(async,csv,fmt): assign default value when undefined is passed #5893

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

petamoriken
Copy link
Contributor

Related #5892 (comment)

When using spread syntax or Object.assign, if a property with undefined is passed, overrides it.

const options = { foo: undefined };

const spreaded = { foo: 1, ...options };
// => { foo: undefined }

const assigned = Object.assign({ foo: 1 }, options);
// => { foo: undefined }

This PR solves that problem by delaying the assignment of default values.

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.31%. Comparing base (2d6c45e) to head (77984dc).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5893      +/-   ##
==========================================
- Coverage   96.33%   96.31%   -0.03%     
==========================================
  Files         483      483              
  Lines       39042    39035       -7     
  Branches     5712     5717       +5     
==========================================
- Hits        37613    37595      -18     
- Misses       1385     1396      +11     
  Partials       44       44              

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

Copy link
Contributor

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

LGTM. Thank you!

@iuioiua iuioiua changed the title fix: assign default value when undefined is passed fix(async,csv,fmt): assign default value when undefined is passed Sep 3, 2024
@iuioiua iuioiua merged commit 5bed4c8 into denoland:main Sep 3, 2024
17 checks passed
@petamoriken petamoriken deleted the fix/options branch September 3, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants