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

Add RequiredDeep type #614

Merged
merged 24 commits into from
May 17, 2023
Merged

Conversation

jarpoole
Copy link
Contributor

Closes #273

This PR is based on a past attempt (see #401) with all the feedback integrated. The only exception is that I did not change args to arguments because as was helpfully noted this is an error inside a strict context like a module.

@jarpoole
Copy link
Contributor Author

CI fails because of xojs/xo#718. Seems like this was fixed in sindresorhus/eslint-plugin-unicorn#2076. I don't really understand what is going wrong here...

@sindresorhus
Copy link
Owner

Is this case handled? #401 (comment)

@sindresorhus
Copy link
Owner

sindresorhus commented May 11, 2023

Should it handle properties that are promises? I looked at some different implementations of this kind of type and noticed this one handles promises: https://github.com/ts-essentials/ts-essentials/blob/master/lib/deep-required/index.ts

@sindresorhus sindresorhus changed the title Added RequiredDeep type Add RequiredDeep type May 11, 2023
@jarpoole
Copy link
Contributor Author

Should it handle properties that are promises? I looked at some different implementations of this kind of type and noticed this one handles promises: https://github.com/ts-essentials/ts-essentials/blob/master/lib/deep-required/index.ts

Yes! I have added support.

@jarpoole
Copy link
Contributor Author

Is this case handled? #401 (comment)

I think I've handled that case now but I'm not 100% sure.

@jarpoole jarpoole requested a review from sindresorhus May 12, 2023 01:50
Multiple call signatures cannot currently be supported due to a TypeScript limitation.
@see https://github.com/microsoft/TypeScript/issues/29732
*/
type HasMultipleCallSignatures<T extends (...arguments: any[]) => unknown> =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the type in source/internal.d.ts.

@jarpoole jarpoole requested a review from sindresorhus May 15, 2023 12:47
@sindresorhus sindresorhus merged commit c2bf374 into sindresorhus:main May 17, 2023
@sindresorhus
Copy link
Owner

Thanks :)

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.

Proposal: RequiredDeep
3 participants