Strings
Uppercase
Upper-cases a string literal type.
What it is
Read the definition: it is `intrinsic`. There is no TypeScript implementing this — the compiler recognises the name and does the work internally, which is why you cannot write your own and why it costs nothing at any length. The same is true of `Lowercase`, `Capitalize` and `Uncapitalize`.
Examples
Uppercase<'hello'>→"HELLO"Uppercase<'a1!'>→"A1!"Characters with no upper-case form pass through untouched — which is exactly the behaviour that makes a naive case test misclassify every digit.
Uppercase<string>→Uppercase<string>
Each resolved type above was printed by TypeScript 5.9.3, not written by hand.
What it does not do
- It does not resolve for a non-literal. `Uppercase<string>` stays deferred, because there is no single answer to give.
- It does not follow locale rules. This is not `toLocaleUpperCase`, and Turkish dotless i is not handled the way a runtime would.
Takeaway
Case-ness is two tests, not one: equal to your upper form *and* different from your lower one. Anything built on a single comparison misclassifies digits and symbols.