Last active
October 2, 2022 09:53
-
-
Save FrameMuse/041c50ea978825709dccdedf9e4f2275 to your computer and use it in GitHub Desktop.
Trasnfoms string literal snake case to camel
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 SnakeToCamelCase<S extends string> = S extends `${infer Start}_${infer Rest}` ? `${Start}${Capitalize<SnakeToCamelCase<Rest>>}` : S | |
type SnakeToCamelCase__TEST__ = SnakeToCamelCase<"my_account_profile"> // myAccountProfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment