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

SetRequired: Fix support for removal of optional modifiers from tuples #1030

Merged
merged 11 commits into from
Jan 5, 2025

Conversation

som-sm
Copy link
Collaborator

@som-sm som-sm commented Jan 2, 2025

This PR:

  1. Fixes SetRequired, enabling it to remove optional modifiers from tuples, for eg.,

    SetRequired<[number?, number?], 0> //=> [number, number?]

    This fix will allow us to solve SetRequiredDeep doesn't remove optional modifiers from tuples #1026.

  2. Fixes minor issues with IsArrayReadonly and adds tests for it.

  3. Adds an internal IfArrayReadonly type.

@som-sm som-sm force-pushed the fix/set-required-type-with-tuples branch from 07f7ec6 to d97191d Compare January 2, 2025 07:09
@sindresorhus
Copy link
Owner

Can you add SetRequired<[number?, number?], 0> //=> [number, number?] to the doc comment? I don't think it's immediately obvious that this is possible.

@sindresorhus sindresorhus merged commit c897aad into main Jan 5, 2025
12 checks passed
@sindresorhus sindresorhus changed the title SetRequired: Fix enabling removal of optional modifiers from tuples SetRequired: Fix support for removal of optional modifiers from tuples Jan 5, 2025
@sindresorhus sindresorhus deleted the fix/set-required-type-with-tuples branch January 5, 2025 00:43
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