What is the purpose of `Capitalize`, `Uppercase`, `Lowercase`, and `Uncapitalize` in TypeScript?

TypeScript Professional Hard

TypeScript Professional — Hard

What is the purpose of `Capitalize`, `Uppercase`, `Lowercase`, and `Uncapitalize` in TypeScript?

Key points

  • These utility types operate on string literals at compile time.
  • They are not runtime functions but rather type-level transformations.
  • `Capitalize` capitalizes the first letter, `Uppercase` converts to uppercase, `Lowercase` converts to lowercase, and `Uncapitalize` makes the first letter lowercase.

Ready to go further?

Related questions