Skip to main content

inRange()

inRange(factVal: unknown, compareVal: unknown): boolean | null

Defined in: rules-engine/src/utils/formatRulesEngine/nativeOperators.ts:10

Determines whether factVal falls within the inclusive range described by compareVal, mirroring the robustness of the "between" handling in formatQuery. The bounds may be supplied as an array ([lo, hi]) or a comma-separated string ("lo,hi"). Numeric bounds are parsed and reordered ascending; non-numeric bounds compare lexicographically in the order given. Returns null when fewer than two valid bounds are present.

Parameters

ParameterType
factValunknown
compareValunknown

Returns

boolean | null


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.