mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
409 B
409 B
date | id | title |
---|---|---|
20201123 | 6c64608e-24e8-4f8a-8f22-6b9bba4a3f0c | Capitalize |
Description
Transforms the first string character to uppercase for string literal types.
Syntax
type CapitalizedGreeting<T extends string> = `${Capitalize<T>}`
type HELLO = CapitalizedGreeting<"hello">;
// same as
// type HELLO = "Hello";