UNPKG

@cuppachino/type-space

Version:

A collection of type utilities for TypeScript.

14 lines (13 loc) 244 B
/** * Returns whether the number is positive * * @example * ``` * IsPositive<-1> // false * ``` * @example * ``` * IsPositive<1> // true * ``` */ export type IsPositive<N extends number> = `${N}` extends `-${number}` ? false : true;