UNPKG

470 BTypeScriptView Raw
1import type {GreaterThan} from './greater-than';
2
3/**
4Returns a boolean for whether a given number is greater than or equal to another number.
5
6@example
7```
8import type {GreaterThanOrEqual} from 'type-fest';
9
10GreaterThanOrEqual<1, -5>;
11//=> true
12
13GreaterThanOrEqual<1, 1>;
14//=> true
15
16GreaterThanOrEqual<1, 5>;
17//=> false
18```
19*/
20export type GreaterThanOrEqual<A extends number, B extends number> = number extends A | B
21 ? never
22 : A extends B ? true : GreaterThan<A, B>;