Skip to content

Add UnwrapRequired type#1410

Open
porada wants to merge 9 commits intosindresorhus:mainfrom
porada:feature/unwrap-required
Open

Add UnwrapRequired type#1410
porada wants to merge 9 commits intosindresorhus:mainfrom
porada:feature/unwrap-required

Conversation

@porada
Copy link
Copy Markdown
Contributor

@porada porada commented Apr 24, 2026

Following up on #1294 and #1296, this PR introduces UnwrapRequired, a type that reverts the Required modifier on object types.

UnwrapRequired mirrors UnwrapPartial’s implementation:

  • No-op for non-Required types.
  • Simplicity over special-casing unions and arrays.
  • Includes similar test cases.

Comment thread test-d/unwrap-required.ts Outdated
@porada porada force-pushed the feature/unwrap-required branch from 6389d29 to 6ac5aa3 Compare April 25, 2026 11:35
Comment thread source/unwrap-required.d.ts Outdated
Comment thread source/unwrap-required.d.ts
@porada porada requested a review from som-sm April 28, 2026 15:56
@porada
Copy link
Copy Markdown
Contributor Author

porada commented May 4, 2026

@som-sm — Let me know if there’s anything else to address.

@porada
Copy link
Copy Markdown
Contributor Author

porada commented May 5, 2026

🎉

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.

3 participants