-
-
Notifications
You must be signed in to change notification settings - Fork 572
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 ifEqual
type guard
#792
Add ifEqual
type guard
#792
Conversation
@sindresorhus @Emiyaaaaa can you guys please review this ? |
Could you add this type to README.md? |
Make sure you read and adhere to: https://github.com/sindresorhus/type-fest/blob/main/.github/contributing.md#submitting-a-new-type |
@Emiyaaaaa this is updated and added doc for all available |
078b3dc
to
b42cf39
Compare
@sindresorhus is it good to be merged ? |
Go through each point and make sure you follow it. |
@sindresorhus I have just started with contribution journey , It would be helpful to let me know what missing in the PR? |
@@ -217,6 +217,13 @@ type ShouldBeNever = IfAny<'not any', 'not never', 'never'>; | |||
- [`IsNever`](source/is-never.d.ts) - Returns a boolean for whether the given type is `never`. (Conditional version: [`IfNever`](source/if-never.d.ts).) | |||
- [`IsUnknown`](source/is-unknown.d.ts) - Returns a boolean for whether the given type is `unknown`. (Conditional version: [`IfUnknown`](source/if-unknown.d.ts).) | |||
|
|||
Currently, `IfType` guards are available for the following checks: | |||
|
|||
- [`IfAny`](source/if-any.d.ts) - Determines if a type is `any`, and returns `TypeIfAny` if true, otherwise `TypeIfNotAny`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's enough to do this so we don't have to duplicate the description:
- [`IfAny`](source/if-any.d.ts) - Determines if a type is `any`, and returns `TypeIfAny` if true, otherwise `TypeIfNotAny`. | |
- [`IfAny`](source/if-any.d.ts) - Conditional version of [`IsAny`](source/is-any.d.ts). |
* An if-else-like type that resolves depending on whether the two given types are equal. | ||
* | ||
* @see {@link IsEqual} | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comments should not be prefixed by *
Reviewing PRs is a lot of work. That's why we have the contribution guidelines. It points out common issues so you can fix it yourself before taking a maintainers time to point out obvious things. Just go through it point by point. |
Added new type IfEqual type guard, to improve on the issue raised #788