Collapse correctly collapses indices into a range when all indices are w/i that range. E.g.
collapse([
['key1', [1,2,3,4,5], 'key2']
])
// > [['key1', { from: 1, to: 5 }, 'key2']]
However, it doesn't collapse indices to a range when there are additional indices outside of that range. E.g.
collapse([
['key1', [1,2,3,4,5,10], 'key2']
])
// > [['key1', [1,2,3,4,5,10], 'key2']]