Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharedUnionFieldsDeep: Skip if input type is not a union type. #798

Merged
merged 2 commits into from
Jan 21, 2024

Conversation

Emiyaaaaa
Copy link
Collaborator

@Emiyaaaaa Emiyaaaaa commented Jan 21, 2024

I found that SharedUnionFieldsDeep have some isuue on handling some variable-length array like

type Arr = [...number[], string]

type R = SharedUnionFieldsDeep<{a: Arr} | {a: Arr}>
//=> {a: (number | string)[]}

I haven't found a good solution currently, but I can skip the non-union type(same type) to alleviate it now.

and this PR will also improves the performance of SharedUnionFieldsDeep

@Emiyaaaaa Emiyaaaaa changed the title SharedUnionFieldsDeep: Skip handling if input type is not a union type. SharedUnionFieldsDeep: Skip if input type is not a union type. Jan 21, 2024
@sindresorhus sindresorhus merged commit 6f1db93 into sindresorhus:main Jan 21, 2024
6 checks 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.

2 participants