-
Notifications
You must be signed in to change notification settings - Fork 653
feat(collections): option to merge undefined
in deepMerge
#6522
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6522 +/- ##
=======================================
Coverage 95.21% 95.22%
=======================================
Files 577 577
Lines 43381 43385 +4
Branches 6487 6489 +2
=======================================
+ Hits 41307 41312 +5
+ Misses 2034 2033 -1
Partials 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
collections/deep_merge.ts
Outdated
* | ||
* @default {"replace"} | ||
*/ | ||
undefined?: "replace" | "ignore"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange that the key is a keyword undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. Maybe undefineds
would be better?
* | ||
* @default {"replace"} | ||
*/ | ||
undefineds?: "replace" | "ignore"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just above, the options are named arrays
, sets
, and maps
, so I think undefineds
does match with those most closely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the point, but the usage of the word undefineds
seems very rare compared to sets
, maps
, arrays
. I'm afraid this might be confusing to the users. (I personally prefer the original undefined
over undefineds
. undefined
is not JavaScript keyword (ref), but just predefined variable name. I personally disagree with @ry's concern..)
resolves #4752
Default is
"replace"
, which is the existing behavior.