Skip to content

fix: handle Date as leaf type in DeepStrictMerge#32

Merged
kakasoo merged 1 commit intomainfrom
kakasoo/fix-deep-pick-union
Feb 20, 2026
Merged

fix: handle Date as leaf type in DeepStrictMerge#32
kakasoo merged 1 commit intomainfrom
kakasoo/fix-deep-pick-union

Conversation

@kakasoo
Copy link
Owner

@kakasoo kakasoo commented Feb 20, 2026

Summary

  • Add Date type guard in DeepStrictMerge.Infer to prevent recursive merging into Date's internal properties
  • Date extends object is true, so without the guard, Date properties were being destructured during deep merge
  • Consistent with how DeepStrictOmit, DeepStrictUnbrand, and DeepDateToString already handle Date as a non-recursive leaf

Test plan

  • Added test_types_deep_strict_merge_date_preserved — disjoint Date properties from Target and Source
  • Added test_types_deep_strict_merge_overlapping_date — same Date key in both Target and Source
  • Added test_types_deep_strict_merge_nested_date — Date properties inside nested objects
  • All 379 tests pass (no regressions)

Closes #20

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kakasoo kakasoo merged commit f23c4e4 into main Feb 20, 2026
1 check passed
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.

[BUG] DeepStrictMerge does not handle Date type (treats it as recursive object)

1 participant