Type Alias IsNotInteger<T, $O>

IsNotInteger<T, $O>: IsNumber<T, {
        $else: $Else;
        $then: $Then;
        distributive: $O["distributive"];
    }> extends infer R
    ? R extends $Then
        ? number extends T
            ? $ResolveBranch<T, $O, [$Then]> | $ResolveBranch<T, $O, [$Else]>
            : T extends number
                ? `${T}` extends `${number}.${number}`
                    ? $ResolveBranch<T, $O, [$Then]>
                    : $ResolveBranch<T, $O, [$Else]>
                : never
        : R extends $Else
            ? IsBigint<T, {
                    $else: $Else;
                    $then: $Then;
                    distributive: $O["distributive"];
                }> extends infer R
                ? R extends $Then
                    ? $ResolveBranch<T, $O, [$Else]>
                    : $ResolveBranch<Exclude<T, number>, $O, [$Then]>
                : never
            : never
    : never

Is T not an integer, including bigint.

import type { IsNotInteger } from 'type-plus'

type R = IsNotInteger<1.1> // true
type R = IsNotInteger<number> // true as it contains non-integer

type R = IsNotInteger<0> // false
type R = IsNotInteger<1n> // false

Type Parameters