Skip to content

Add UnwrapRequired type#1410

Merged
sindresorhus merged 9 commits into
sindresorhus:mainfrom
porada:feature/unwrap-required
May 31, 2026
Merged

Add UnwrapRequired type#1410
sindresorhus merged 9 commits into
sindresorhus:mainfrom
porada:feature/unwrap-required

Conversation

@porada

@porada porada commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

porada commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@porada

porada commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

🎉

@som-sm som-sm requested a review from sindresorhus May 31, 2026 10:12
@sindresorhus sindresorhus merged commit 3bfee8e into sindresorhus:main May 31, 2026
8 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.

3 participants