Created
June 25, 2023 05:21
-
-
Save ikasoba/684b9af69cfc58a2561e11d41bf51a46 to your computer and use it in GitHub Desktop.
型レベルの論理なんちゃら
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 And<A extends boolean, B extends boolean> = (A | B) extends true ? true : false; | |
type Or<A extends boolean, B extends boolean> = true extends (A | B) ? true : false; | |
type Not<A extends boolean> = A extends false ? true : false; | |
type Xor<A extends boolean, B extends boolean> = boolean extends (A | B) ? true : false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment