import type {IsNumericLiteral} from 'type-fest';
type A = IsNumericLiteral<0>;
//=> true
type B = IsNumericLiteral<number>;
//=> false
type C = IsNumericLiteral<100n>;
//=> true
type D = IsNumericLiteral<bigint>;
//=> false
type E = IsNumericLiteral<1 | 2 | 10n | 20n>;
//=> true
type F = IsNumericLiteral<number | bigint>;
//=> false
type G = IsNumericLiteral<1 | bigint>;
//=> boolean
Returns a boolean for whether the given type is a
numberorbigintliteral type.