a sorted set, with user-supplied sorting.
npm install sorted-cmp-set
var SortedSet = require('sorted-cmp-set')
Creates a new sorted set with the supplied comparison function, backed by either a fresh array or a supplied one.
The backing array.
Inserts an element into the set.
Returns true
if it added the element, false
if it replaced an existing element.
Returns the index of the element, or -1
if it wasn't found.
Removes an element from the set.
Returns true
if the element was removed, false
if it wasn't there in the first place.