API Reference / @evolu/common / BigInt / isBetweenBigInt

Function: isBetweenBigInt()

function isBetweenBigInt(min, max): Predicate<bigint>;

Defined in: packages/common/src/BigInt.ts:27

Creates a predicate that checks if a BigInt is within a range, inclusive.

Example

const isBetween10And20 = isBetweenBigInt(10n, 20n);
console.log(isBetween10And20(15n)); // true
console.log(isBetween10And20(25n)); // false

Parameters

ParameterType
minbigint
maxbigint

Returns

Predicate<bigint>

Was this page helpful?