Releases: nvie/itertools
Releases · nvie/itertools
v2.1.1
v2.1.0
-
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 asfirst(iterable, pred)
but behaves slightly more intuitive in the case where no predicate function is given. -
Fix bug in
chunked()
withsize=1
v2.0.0
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
, andcompactObject
functions will now also removenull
values, not onlyundefined
-
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
Breaking changes:
icompact
,compact
, andcompactObject
functions will now also remove
null
values, not onlyundefined
- 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