Skip to content

Releases: nvie/itertools

v2.3.1

04 Apr 23:53
Compare
Choose a tag to compare
  • Actually export the new itertool at the top level

v2.3.0

04 Apr 23:50
Compare
Choose a tag to compare
  • Add new dupes(iterable, keyFn?) function, which returns groups of all duplicate items in iterable.

v2.2.5

07 Mar 08:09
Compare
Choose a tag to compare
  • Add missing export for repeat

v2.2.4

19 Feb 21:32
Compare
Choose a tag to compare
  • Type output types of all itertools more precisely

v2.2.3

09 Jan 16:35
Compare
Choose a tag to compare

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

09 Jan 14:20
Compare
Choose a tag to compare
  • Fix reduce() bug where using it on a lazy iterable would produce the wrong result (thanks for finding, @quangloc99 🙏!)

v2.2.1

04 Jan 19:02
Compare
Choose a tag to compare
  • Fix islice() regression where it wasn't stopping on infinite iterables (thanks for finding, @Kareem-Medhat 🙏!)

v2.2.0

27 Dec 19:43
Compare
Choose a tag to compare
  • Move to ESM by default
  • Drop support for node 12.x and 14.x
    (they probably still work, but they're EoL)

v2.1.2

03 Jul 10:06
Compare
Choose a tag to compare

Improve tree-shakability when used in bundlers.

v2.1.1

11 Apr 07:40
Compare
Choose a tag to compare
  • Improve documentation
  • Fix a minor edge case bug in reduce() (when first argument in iterable is undefined, and the predicate function was not explicitly set)