Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 565 Bytes

File metadata and controls

43 lines (31 loc) · 565 Bytes

typelab / assertions / IsPrimitive

type IsPrimitive<T> = _IsTrue<IfPrimitive<T, true, false>>;

Checks if a given type T is a Primitive type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a Primitive type, false otherwise.

Example

type Valid = IsPrimitive<string>; // true
type Invalid = IsPrimitive<object>; // false