binary-sorted-set
keep a set of objects in order.
example
var BinarySortedSet =//pass in a compare function (same as Array#sort)var set =setset//take a range as an array.console
api
BinarySortedSet(compare(a, b) => -1|0|1))
construct a new instance of a BinarySortedSet. The compare function must take two set items and return -1 if a < b, 1 if a > b and 0 if they are equal (i.e. the same as Array#sort)
bss.add(item)
add an item to the set.
bss.rm(item)
remove an item from the set.
bss.has(item)
check if an item is in the set.
bss.range({gt, gte, lt, lte})
take a range from within the set, using levelup style ranges.
License
MIT