$ open source · GPL-3.0 — need a commercial license? imqueue.com →

IRange interface

The shape every range filter shares: a start and an end.

Signature:

export interface IRange 

Remarks

query.withRangeFilters recognises a range by exactly these two keys, in either order, on a filter property whose name ends in Range. So the property NAMES are the contract — an object with any other key set is left alone and filtered as an ordinary value.

The convention it implements: a caller filters durationRange and the helper rewrites it onto the real duration column. Sending both duration and durationRange is an error rather than a merge — see DateRange for the worked example.

Deliberately untyped at any, so a range of anything Postgres supports can implement it; DateRange and NumericRange are the two the package ships.

Properties

Property

Modifiers

Type

Description

end

any

Upper bound of the range.

start

any

Lower bound of the range.