You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
when merging together deeply nested object (e.g react state), it's important to get 'nonempty' values when merging 'empty' values with 'nonempty' values.
for array, map and set it defaults to merging empty and non-empty values together:
however, it doesn't work with nullish values. it'd be very useful to be able to output non-nullish value from merging nullish and non-nullish value together.
Is your feature request related to a problem? Please describe.
when merging together deeply nested object (e.g react state), it's important to get 'nonempty' values when merging 'empty' values with 'nonempty' values.
for array, map and set it defaults to merging empty and non-empty values together:
however, it doesn't work with nullish values. it'd be very useful to be able to output non-nullish value from merging nullish and non-nullish value together.
Describe the solution you'd like
in DeepMergeOptions, add
nullish: MergingStrategy
that controls whetherdeepMerge
will choose non-nullish value over nullish ones, such thatalways holds. (currently the return type of
merge
will beUpdateState
)Describe alternatives you've considered
make
nullish: "merge”
as default. this may cause breaking changes.The text was updated successfully, but these errors were encountered: