find-sequence
Find all sequences of elements in an array
Installation
npm install find-sequence
Usage
const findSeq = const zeroSequences = console // [ {start: 0, end: 0}, {start: 2, end: 2}, {start: 4, end: 6}, {start: 9, end: 10} ] // function as iterator const iterator = { return b === a - 1 } const sequences = console // [ {start: 0, end: 3}, {start: 5, end: 7} ]
Contributions / Issues
Please feel free to open an issue or a PR if something's broken, or if you'd like some specific features added.
License
MIT