UNPKG

ts-extras

Version:

Essential utilities for TypeScript projects

25 lines (18 loc) 454 B
import { type NegativeInfinity, type PositiveInfinity } from 'type-fest'; /** Check whether a value is infinite. @example ``` import {isInfinite} from 'ts-extras'; isInfinite(Number.POSITIVE_INFINITY); //=> true isInfinite(Number.NEGATIVE_INFINITY); //=> true isInfinite(42); //=> false isInfinite(Number.NaN); //=> false ``` @category Type guard */ export declare function isInfinite(value: unknown): value is NegativeInfinity | PositiveInfinity;