Skip to content

fix[merge, mergeWith]: clone source objects over primitive target values - #2221

Open
anubhavlal07 wants to merge 2 commits into
toss:mainfrom
anubhavlal07:fix/merge-primitive-target
Open

anubhavlal07 wants to merge 2 commits into
toss:mainfrom
anubhavlal07:fix/merge-primitive-target

Conversation

@anubhavlal07

@anubhavlal07 anubhavlal07 commented Nov 14, 2026 •

Copy link
Copy Markdown

Refs #2218

In compat mode, merge was incorrectly reusing the source object when the target value was a primitive, causing mutations to leak back into the source. This fix clones plain-object and typed-array sources in those cases to match Lodash behavior, alongside two new test cases and an update to the bundle-size snapshots.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 16:44
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
es-toolkit Ready Ready Preview Nov 14, 2026 4:53pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch was successfully deployed

1 active deployment
Preview — 8bcfb51f Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants