Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 591 Bytes

File metadata and controls

43 lines (31 loc) · 591 Bytes

typelab / assertions / IsNumberLiteral

type IsNumberLiteral<T> = _IsTrue<IfNumberLiteral<T, true, false>>;

Checks if a given type T is a Number Literal type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a Number Literal type, false otherwise.

Example

type Valid = IsNumberLiteral<11>; // true
type Invalid = IsNumberLiteral<number>; // false