Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 542 Bytes

File metadata and controls

43 lines (31 loc) · 542 Bytes

typelab / assertions / IsBoolean

type IsBoolean<T> = _IsTrue<IfBoolean<T, true, false>>;

Checks if a given type T is a boolean.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a boolean, false otherwise.

Example

type Valid = IsBoolean<boolean>; // true
type Invalid = IsBoolean<string>; // false