Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 539 Bytes

File metadata and controls

43 lines (31 loc) · 539 Bytes

typelab / assertions / IsNumber

type IsNumber<T> = _IsTrue<IfNumber<T, true, false>>;

Checks if a given type T is a number type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a number, false otherwise.

Example

type Valid = IsNumber<number>; // true
type Invalid = IsNumber<string>; // false