Skip to content

Releases: nvie/itertools

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)

v2.1.0

10 Apr 19:54
Compare
Choose a tag to compare
  • The following functions retain richer type information about their arguments:

    • ifilter()
    • filter()
    • partition()

    For example, TypeScript will now know the following:

    const items = [3, 'hi', -7, 'foo', 13];
    
    function isNum(value: unknown): value is number {
        return typeof value === 'number';
    }
    
    const numbers: number[] = filter(items, isNum); // ✅
    
    const [numbers, strings] = partition(items, isNum); // ✅
    //     ^^^^^^^  ^^^^^^^ string[]
    //     number[]
  • Add new find(iterable, pred) function, which is almost the same as first(iterable, pred) but behaves slightly more intuitive in the case where no predicate function is given.

  • Fix bug in chunked() with size=1

v2.0.0

10 Apr 09:35
Compare
Choose a tag to compare

Breaking changes:

  • Rewritten source code in TypeScript (instead of Flow)
  • Modern ESM and CJS dual exports (fully tree-shakable when using ESM)
  • Massively reduced bundle size
  • Targeted ES2015 (instead of ES5)
  • Support only TypeScript versions >= 4.3
  • Drop Flow support1
  • Drop Node 10.x support
  • icompact, compact, and compactObject functions will now also remove null values, not only undefined
  1. I'm still open to bundling Flow types within this package, but only if that can be supported in a maintenance-free way, for example by using a script that will generate *.flow files from TypeScript source files. If someone can add support for that, I'm open to pull requests! 🙏

v2.0.0-beta1

10 Apr 08:44
Compare
Choose a tag to compare
v2.0.0-beta1 Pre-release
Pre-release

Breaking changes:

  • icompact, compact, and compactObject functions will now also remove
    null values, not only undefined
  • Support only Node >= 12.x
  • Support only TypeScript versions >= 4.3
  • Drop Flow support

Changes:

  • Modern ESM and CJS dual exports
  • Rewrite the source code in TypeScript

v1.7.1

01 Oct 06:36
Compare
Choose a tag to compare
  • Add missing re-export of islice at the top level

v1.7.0

29 Jun 19:55
Compare
Choose a tag to compare
  • TypeScript support!
  • Declare official support for Node 16.x
  • Drop support for Node 13.x (unstable release)

v1.6.1

11 Sep 15:31
Compare
Choose a tag to compare
  • Include an error code with every FlowFixMe suppression (Flow 0.132.x compatibility)

v1.6.0

11 Dec 09:17
Compare
Choose a tag to compare

v1.5.4

10 Dec 12:03
Compare
Choose a tag to compare
  • Export roundrobin() at the top level

v1.5.3

09 Dec 09:33
Compare
Choose a tag to compare
  • Fix bug in chunked() when input is exactly dividable