UNPKG

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