Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 600 Bytes

File metadata and controls

43 lines (31 loc) · 600 Bytes

typelab / assertions / IsPositive

type IsPositive<T> = _IsTrue<IfPositive<T, true, false>>;

Checks if a given number T is positive.

Type Parameters

Type Parameter Description

T extends number | bigint | string

The type to be checked.

Returns

true if T is a positive number, false otherwise.

Example

type Valid = IsPositive<11 | 11n>; // true
type Invalid = IsPositive<-11 | -11n>; // false