Last active
August 25, 2022 12:55
-
-
Save Luisgustavom1/ece43b91de4e513dcefbea40e31d93d1 to your computer and use it in GitHub Desktop.
This is a reverse string using type level of typescript
This file contains 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 Reverse<A extends string> = | |
`${A}` extends `${infer H}${infer T}` | |
? `${Reverse<T>}${H}` | |
: A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment