Type Alias IsEqual<A, B, Then, Else>
IsEqual: [A, B] extends [B, A] ? BothNever< A, B, Then, Else, BothAny< A, B, Then, Else, IdentityEqual< A, B, Then, And< IsObject<A>, IsObject<B>, { $else: [A, B] extends [B, A] ? Then : Else; $then: IdentityEqual< Properties<A>, Properties<B>, [A, B] extends [ (...args: infer P1) => any, (...args: infer P2) => any, ] ? IsEqual<P1, P2, Then, Else> : Then, Else, >; }, >, >, >, > : And< IsSymbol<A, { distributive: false }>, IsSymbol<B, { distributive: false }>, { $else: Else; $then: Then }, > Type Parameters
- A
- B
- Then = true
- Else = false
Checks
A
andB
are equal.Note that intersection type checks only works at first level. It cannot be check recursively, or else will run into infinite recursion if the type includes recursive types.