idb-range
MongoDB inspired interface for
IDBKeyRange
.
Installation
npm install --save idb-range
Example
// IDBKeyRange {lower: "a", upper: "b", lowerOpen: true, upperOpen: true} // IDBKeyRange {lower: "c", upper: undefined, lowerOpen: false, upperOpen: true} // it accepts a specific value as a shortcut to IDBKeyRange.only // IDBKeyRange {lower: "hello", upper: "hello", lowerOpen: false, upperOpen: false}// but it's more explicit to always use object notation // IDBKeyRange and no arguments are ignored // ignores IDBKeyRange instances // null
range(opts)
Parse opts
to valid IDBKeyRange
.
Available options, when opts
is an object:
gt
- greaterlt
- lightergte
- greater equallte
- lighter equaleq
- equal