Skip to content

fix: support tuple types in DeepStrictObjectKeys#28

Merged
kakasoo merged 1 commit intomainfrom
kakasoo/fix-tuple-keys
Feb 19, 2026
Merged

fix: support tuple types in DeepStrictObjectKeys#28
kakasoo merged 1 commit intomainfrom
kakasoo/fix-tuple-keys

Conversation

@kakasoo
Copy link
Owner

@kakasoo kakasoo commented Feb 19, 2026

Summary

  • Fixed DeepStrictObjectKeys to properly handle heterogeneous tuple types (e.g., [{ a: 1 }, { b: 2 }]) by adding a DistributeInfer wrapper that distributes over union element types
  • Previously, nested keys were lost because keyof (A | B) resolves to never when A and B share no common keys
  • Added 9 comprehensive tuple test cases covering empty, primitive, readonly, same-shape, and heterogeneous tuples

Closes #6

Test plan

  • npm run build:test && npm run test — all 338 tests pass (329 existing + 9 new)
  • npm run prettier — formatting applied

🤖 Generated with Claude Code

…er union element types

Heterogeneous tuples (e.g., [{ a: 1 }, { b: 2 }]) were losing nested keys because
Infer did not distribute over union element types, causing keyof (A | B) to resolve
to never. Added DistributeInfer wrapper and comprehensive tuple tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kakasoo kakasoo merged commit 42627d1 into main Feb 19, 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.

[Discussion] Support for tuple types

1 participant