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 IsEqual type #522
Add IsEqual type #522
Conversation
c9eeed7
to
5d58998
Compare
https://github.com/sindresorhus/type-fest/pull/522/files#r1033002320 still needs to be done |
https://github.com/sindresorhus/type-fest/pull/522/files#r1033002320 still needs to be done |
Sorry, I misread. |
FYI There are two self-identity bugs that can pretty simply be fixed: TS Playground Both of these evaluate to false: IsEqual<{a: 1} & {a: 1}, {a: 1}>
IsEqual<{a: 1} | {a: 1}, {a: 1}> The fix is to expand the check a touch: type IsEqual<A, B> =
(<G>() => G extends A & G | G ? 1 : 2) extends
(<G>() => G extends B & G | G ? 1 : 2)
? true
: false; There's also this bug but I'm unaware of a fix: TS Playground This evaluates to false: IsEqual<{a: 1} & {b: 2}, {a: 1, b: 2}> |
@trevorade Would you mind moving this to an issue instead? Otherwise it will be forgotten. |
Created #537 |
Close #346