Determines if a type can be upcast to its primitive base type.
Returns true for literal types (e.g., 'hello', 42, true) that can be
upcast to their primitive base (string, number, boolean).
Returns false for primitive base types and non-primitive types.
Uses non-distributive conditionals to handle union types correctly.
Type Parameters
T
The type to check
Returns
true if the type is a primitive literal, false otherwise
Determines if a type can be upcast to its primitive base type.
Returns
truefor literal types (e.g.,'hello',42,true) that can be upcast to their primitive base (string,number,boolean). Returnsfalsefor primitive base types and non-primitive types.Uses non-distributive conditionals to handle union types correctly.