Open utterances-bot opened 1 year ago
This project is aimed at helping you better understand how the type system works, writing your own utilities, or just having fun with the challenges.
https://ghaiklor.github.io/type-challenges-solutions/en/hard-camelcase.html
I kind find this do the job.
type CamelCase<S extends string> = S extends `${infer H}-${infer T}` ? `${H}${CamelCase<Capitalize<T>>}` : S
CamelCase
This project is aimed at helping you better understand how the type system works, writing your own utilities, or just having fun with the challenges.
https://ghaiklor.github.io/type-challenges-solutions/en/hard-camelcase.html