Type Alias IsPositive<T, $O>

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

Is T a positive numeric type.

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

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

type R = IsPositive<-1> // false

Type Parameters