Type Alias IsNotNegative<T, $O>

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

Is T a not a negative numeric type.

type R = IsNotNegative<1> // true
type R = IsNotNegative<0> // true
type R = IsNotNegative<1n> // true

type R = IsNotNegative<-1> // false

type R = IsNotNegative<number> // boolean
type R = IsNotNegative<bigint> // boolean
type R = IsNotNegative<any> // boolean

Type Parameters