UNPKG

@cuppachino/type-space

Version:

A collection of type utilities for TypeScript.

14 lines (13 loc) 257 B
/** * Returns whether the number is a whole number * * @example * ``` * IsInteger<1> // true * ``` * @example * ``` * IsInteger<1.5> // false * ``` */ export type IsInteger<N extends number> = `${N}` extends `${number}.${number}` ? false : true;