CON-2075: replace merge-deep with deepmerge#145
Open
PavelLoparev wants to merge 3 commits intomasterfrom
Open
Conversation
Drops the unmaintained merge-deep dependency (along with 15 transitive CommonJS micro-packages) in favor of deepmerge — a zero-dependency, ESM-friendly library with built-in TypeScript types. A custom arrayMerge option preserves the ordered-unique-concat (union) semantics that merge-deep exposed via arr-union, so callers that rely on the old array handling see no behavior change. New characterization tests in test/base-api-merge.spec.ts pin the deep-merge contract (library-level + SmartlingBaseApi integration) and all 234 tests pass on both the old and new dependency. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…verage Move the deep-merge helper out of base-api.ts into api/base/merge.ts so it no longer looks like a public symbol on the main API surface. Tighten its signature from any to a generic T & U to drop the eslint-disable. Strip ticket-id and migration framing from comments so they stay useful after the merge-deep swap is ancient history. Extend test coverage with null/undefined source values, array vs object type mismatches, reference-based array-of-objects dedup, two prototype pollution cases, and an integration test that flows array-valued headers through setOptions to prove the arrayMerge option is reached in production. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…erge Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dimitrystd
approved these changes
Apr 17, 2026
vsolovei-smartling
approved these changes
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
merge-deep@3.0.3fordeepmerge@^4.3.1(CON-2075, #144)package-lock.json(merge-deep,arr-union,clone-deep,kind-of+ deps); adds ~4 KB, zero-dep, ESM-friendlydeepmergewith built-in TS typesarrayMergeoption so existing callers see zero behavior changetest/base-api-merge.spec.tswith 19 characterization tests (13 library-level + 6SmartlingBaseApiintegration) that pin the deep-merge contract across the swapWhy array semantics matter
merge-deepdelegates array handling toarr-union, which de-duplicates while preserving order ([1,2,3] + [2,3,4] → [1,2,3,4]).deepmerge's default is plain concat ([1,2,3,2,3,4]). The customarrayMergeinmergeOptionsreproduces the old union behavior exactly, so any caller that passed header/option arrays and relied on dedup stays correct.Test plan
merge-deep(before swap)deepmerge(after swap) — proves paritynpm test(lint + build + coverage) — 234 passing, 0 failuresnpm run pretest— no new lint errors (3 pre-existing warnings onsensitiveReplacerunchanged)🤖 Generated with Claude Code