Skip to content

fix: deduplicate complex unions and intersections#654

Merged
mrazauskas merged 3 commits intomainfrom
fix-deduplicate-complex
Jan 10, 2026
Merged

fix: deduplicate complex unions and intersections#654
mrazauskas merged 3 commits intomainfrom
fix-deduplicate-complex

Conversation

@mrazauskas
Copy link
Member

This change makes it possible to deduplicate complex unions and intersections. The following will work as expected:

import { expect } from "tstyche";

expect<({ a: string } | { b: number }) & ({ a: string } | { b: number })>().type.toBe<
  { a: string } | { a: string; b: number } | { b: number }
>();

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00% (target: 85.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (af6f31c) 7238 7146 98.73%
Head commit (aecae93) 7250 (+12) 7158 (+12) 98.73% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#654) 41 41 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@mrazauskas mrazauskas merged commit 6d5ce11 into main Jan 10, 2026
22 checks passed
@mrazauskas mrazauskas deleted the fix-deduplicate-complex branch January 10, 2026 14:52
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.

1 participant