Loading...
type Method = 'get' | 'post';
type MethodConst = 'GET' | 'POST';type Method = 'get' | 'post';
type MethodConst = Uppercase<Method>;The uppercase union is derived from the source, so a new method appears in both types at once.
toUpperCase(), the type alone does not change the string.string stays string.No, it only transforms the type. Call toUpperCase() on the value and the type stays in sync.
Yes, e.g. `ON_${Uppercase<Event>}` turns 'click' into 'ON_CLICK'.