predictype / predicates/bigints/bigintRange / bigintRange
bigintRange(
source
,oper
,min
,max
):boolean
Defined in: predicates/bigints/bigintRange.ts:30
Checks if a bigint value falls within or outside a specified range using the given operation.
bigint
The source bigint value.
The range operation to perform (e.g. ‘between’, ‘not_between’).
bigint
The minimum value of the range (inclusive).
bigint
The maximum value of the range (inclusive).
boolean
True if the range check is valid according to the operator, otherwise false.
If the operation is not recognized.
const value1 = BigInt(5);
const value2 = BigInt(15);
const min = BigInt(1);
const max = BigInt(10);
bigintRange(value1, 'between', min, max); // true
bigintRange(value2, 'not_between', min, max); // true
Supported Operators: