Socket
Socket
Sign inDemoInstall

itertools

Package Overview
Dependencies
0
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
2345Next

2.3.1

Diff

Changelog

Source

[2.3.1] - 2024-04-05

  • Actually export the new itertool at the top level
nvie
published 2.3.0 •

Changelog

Source

[2.3.0] - 2024-04-05

  • Add new dupes(iterable, keyFn?) function, which returns groups of all duplicate items in iterable.
nvie
published 2.2.5 •

Changelog

Source

[2.2.5] - 2024-03-07

  • Add missing export for repeat
nvie
published 2.2.4 •

Changelog

Source

[2.2.4] - 2024-02-19

  • Type output types of all itertools more precisely
nvie
published 2.2.3 •

Changelog

Source

[2.2.3] - 2024-01-09

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! 🙏

nvie
published 2.2.2 •

Changelog

Source

[2.2.2] - 2024-01-09

  • Fix reduce() bug where using it on a lazy generator would produce the wrong result (thanks for finding, @quangloc99 🙏!)
nvie
published 2.2.1 •

Changelog

Source

[2.2.1] - 2024-01-04

  • Fix islice() regression where it wasn't stopping on infinite iterables (thanks for finding, @Kareem-Medhat 🙏!)
nvie
published 2.2.0 •

Changelog

Source

[2.2.0]

  • Move to ESM by default
  • Drop support for node 12.x and 14.x
    (they probably still work, but they're EoL)
nvie
published 2.2.0-test2 •

nvie
published 2.2.0-test1 •

2345Next
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc