typelab / assertions / IsPrimitive
type IsPrimitive<T> = _IsTrue<IfPrimitive<T, true, false>>;Checks if a given type T is a Primitive type.
| Type Parameter | Description |
|---|---|
|
|
The type to be checked. |
true if T is a Primitive type, false otherwise.
type Valid = IsPrimitive<string>; // true
type Invalid = IsPrimitive<object>; // false