Created
March 12, 2019 14:57
-
-
Save achmedzhanov/bfa46e2400b70ac2d9182a3859c58de2 to your computer and use it in GitHub Desktop.
TypeScript equeal types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Eq<T1, T2> = Diff<T1, T2> extends never ? Diff<T2, T1> extends never ? 'equals' : 'neq' : 'neq; | |
type et1 = Eq<string, number>; | |
type et2 = Eq<string, string>; | |
type et3 = Eq<string, string | number>; | |
type et4 = Eq<string | number, string>; | |
type et5 = Eq<null, null>; | |
type et6 = Eq<string | null, null>; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment