GreaterThan<A, B>
GreaterThan<
A
,B
> =number
extendsA
|B
?never
: [IsEqual
<A
,PositiveInfinity
>,IsEqual
<A
,NegativeInfinity
>,IsEqual
<B
,PositiveInfinity
>,IsEqual
<B
,NegativeInfinity
>] extends infer R ?Or
<And
<IsEqual
<R
[0
],true
>,IsEqual
<R
[2
],false
>>,And
<IsEqual
<R
[3
],true
>,IsEqual
<R
[1
],false
>>> extendstrue
?true
:Or
<And
<IsEqual
<R
[1
],true
>,IsEqual
<R
[3
],false
>>,And
<IsEqual
<R
[2
],true
>,IsEqual
<R
[0
],false
>>> extendstrue
?false
:true
extendsR
[number
] ?false
: [IsNegative
<A
>,IsNegative
<B
>] extends infer R ? [true
,false
] extendsR
?false
: [false
,true
] extendsR
?true
: [false
,false
] extendsR
?PositiveNumericStringGt
<`${(...)}`
,`${(...)}`
> :PositiveNumericStringGt
<`${(...)}`
,`${(...)}`
> :never
:never
Defined in: packages/react-querybuilder/src/types/type-fest/greater-than.ts:26
Returns a boolean for whether a given number is greater than another number.
Type Parameters
Type Parameter |
---|
A extends number |
B extends number |
Example
import type {GreaterThan} from 'type-fest';
GreaterThan<1, -5>;
//=> true
GreaterThan<1, 1>;
//=> false
GreaterThan<1, 5>;
//=> false
API documentation is generated from the latest commit on the main
branch. It may be somewhat inconsistent with official releases of React Query Builder.