Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 445 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 445 Bytes

CamelCase<Type> converts type Type to camel case (e.g. camelCase)

type OneWordExample = CamelCase<"ONEWORD">;
//   ^? 'oneword'

type TwoWordsExample = CamelCase<"two_words">;
//   ^? 'twoWords'

type ThreeWordsExample = CamelCase<"HERE-THREE-WORDS">;
//   ^? 'hereThreeWords'

It supports:

  • COBOL-CASE
  • CONSTANT_CASE
  • PascalCase
  • camelCase
  • kebab-case
  • oneword
  • snake_case

TS Playground – https://tsplay.dev/mpjrMw