Skip to content

overwriteWithEmptyValue is forced to true when merging an object involving maps #187

Closed
@liggitt

Description

@liggitt

#85 introduced a bug that can leave overwriteWithEmptyValue set to true if a map is encountered, but one of the continue or return statements is called before calling deepMerge (which reset to false)

https://github.com/imdario/mergo/blob/29fb3d3bdc5512887f1dc9aedde6a0fed407fa8f/map.go#L72-L100

#133 made the bug worse by removing the reset to false in deepMerge, so now, any merge involving a map leaves overwriteWithEmptyValue set to true for all remaining merges.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions