Gets the primitive base type for a given type.
Returns the primitive type that a literal can be upcast to. Returns never for non-primitive types.
never
The type to get the primitive for
The primitive base type or never
type A = GetUpcastable<'hello'>; // stringtype B = GetUpcastable<42>; // numbertype C = GetUpcastable<true>; // booleantype D = GetUpcastable<object>; // never Copy
type A = GetUpcastable<'hello'>; // stringtype B = GetUpcastable<42>; // numbertype C = GetUpcastable<true>; // booleantype D = GetUpcastable<object>; // never
Gets the primitive base type for a given type.
Returns the primitive type that a literal can be upcast to. Returns
neverfor non-primitive types.