UNPKG

@cuppachino/type-space

Version:

A collection of type utilities for TypeScript.

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