Skip to content

refactor: consolidate deepMerge and deepMergeDefaults (#433)#476

Merged
evantahler merged 2 commits into
mainfrom
evantahler/issue-433
Apr 29, 2026
Merged

refactor: consolidate deepMerge and deepMergeDefaults (#433)#476
evantahler merged 2 commits into
mainfrom
evantahler/issue-433

Conversation

@evantahler

Copy link
Copy Markdown
Member

Summary

  • DRY up packages/keryx/util/config.ts by routing both deepMerge and deepMergeDefaults through a single internal mergeWith helper with an \"overwrite\" | \"defaults\" mode flag — public signatures and behavior are unchanged, so no call sites needed updating.
  • Add three edge-case tests for deepMergeDefaults to lock in semantics that were not previously asserted: type mismatch (target object vs source scalar), nullish target value treated as set, and filling a missing nested object wholesale.
  • Bump keryx to 0.29.10.

closes #433

Test plan

  • `bun test-package` (774 pass, was 771)
  • `bun lint` clean across all workspaces

🤖 Generated with Claude Code

Both functions now delegate to a shared mergeWith helper with an
internal mode flag. Public signatures and behavior are unchanged;
adds three edge-case tests (type mismatch, null target, missing
nested object) to lock in semantics.

closes #433

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@evantahler evantahler enabled auto-merge (squash) April 29, 2026 05:08
Auto-merge is now allowed for PRs in this repo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@evantahler evantahler merged commit b09ff88 into main Apr 29, 2026
14 checks passed
@evantahler evantahler deleted the evantahler/issue-433 branch April 29, 2026 05:10
evantahler added a commit that referenced this pull request Apr 29, 2026
Resolve conflicts:
- config.ts: take upstream's mergeWith consolidation (#476) but drop the
  `(target as any)[key]` cast it kept, finishing the work of #436 against
  the new structure. Tighten the helper to Record<string, unknown>.
- webCompression.ts: re-add the @ts-ignore + comments on the new
  compressBody helper (#475) for downstream consumers compiling under
  `lib: ["DOM"]`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

DRY: Consolidate deepMerge and deepMergeDefaults into a single function

1 participant