Return an item for a given identity when comparator return 0
Update binary search for query.index
to return a range of items when the comparator returns 0 in order to return the index of item for a given identity.
For example:
var items = [
{id: 1, name: "Item 0"},
{id: 2, name: "Item 1"},
{id: 3, name: "Item 1"},
{id: 4, name: "Item 1"},
{id: 5, name: "Item 2"}
];
var query = new BasicQuery({
sort: "name"
});
var res = query.index({id:4, name: "Item 1"}, items); // -> 3