Releases: nvie/itertools
Releases · nvie/itertools
v2.3.2
v2.3.1
v2.3.0
v2.2.5
v2.2.4
v2.2.3
Fixes a bug where some iterators would render an inputted generator unusable, causing it to no longer be consumable after the iterable returns.
Example:
function* gen() {
yield 1;
yield 2;
yield 3;
yield 4;
}
const lazy = gen();
// [1, 2]
Array.from(islice(lazy, 0, 2));
Array.from(lazy);
// ❌ Previously: []
// ✅ Now correctly: [3, 4]
This bug only happened when the source was a generator. It did not happen on a normal iterable.
Similar bugs were present in:
find()
islice()
takewhile()
dropwhile()
No other iterables were affected by this bug. This is the same bug that was fixed in 2.2.2 for reduce()
, so many thanks again for surfacing this edge case, @quangloc99! 🙏
v2.2.2
- Fix
reduce()
bug where using it on a lazy iterable would produce the wrong result (thanks for finding, @quangloc99 🙏!)
v2.2.1
- Fix
islice()
regression where it wasn't stopping on infinite iterables (thanks for finding, @Kareem-Medhat 🙏!)