Releases: Smoren/itertools-ts
Releases · Smoren/itertools-ts
combinatorics.combinations() added
New namespace added: combinatorics
New features
- combinatorics
permutations()
permutationsAsync()
cartesianProduct()
cartesianProductAsync()
- Stream
permutations()
- AsyncStream
permutations()
Improvements
toArray()
function optimized.
Deprecations
- set
cartesianProduct()
(usecombinatorics.cartesianProduct()
instead).cartesianProductAsync()
(usecombinatorics.cartesianProductAsync()
instead).
Stream and AsyncStream made generics to save the typing
Improvements
- Stream and AsyncStream are fully refactored
- Classes made generic.
- All the methods made generic and save the typing.
- reduce
toValue()
,toValueAsync()
— union return type has been replaced by inferred type.toRange()
,toRangeAsync()
— useNumeric
type in arguments.
- multi
- Type
ZipTuple
— added support for iterators and async iterables / iterators.
- Type
- math
- All the methods use
Numeric
type in arguments.
- All the methods use
- All the tests are refactored to check the typing.
- Found bugs fixed.
New features
- types
Numeric
NumericString
Union return type in groupBy replaced by inferred type
Improvements
- single
groupBy()
— union return type has been replaced by inferred type.groupByAsync()
— union return type has been replaced by inferred type.
function* groupBy<
T,
TItemKeyFunction extends ((item: T) => string) | undefined,
TResultItem extends TItemKeyFunction extends undefined ? [string, Array<T>] : [string, Record<string, T>]
>(
data: Iterable<T> | Iterator<T>,
groupKeyFunction: (item: T) => string,
itemKeyFunction?: TItemKeyFunction
): Iterable<TResultItem>;
async function* groupByAsync<
T,
TItemKeyFunction extends ((item: T) => string) | undefined,
TResultItem extends TItemKeyFunction extends undefined ? [string, Array<T>] : [string, Record<string, T>]
>(
data: AsyncIterable<T> | AsyncIterator<T> | Iterable<T> | Iterator<T>,
groupKeyFunction: (item: T) => (string | Promise<string>),
itemKeyFunction?: (item: T) => (string | Promise<string>)
): AsyncIterable<TResultItem>;
Pipe.add() method added
New features
- Pipe
add()
Documentation fixed
v1.28.1 CHANGELOG updated.
createPipe() function added
New features
createPipe()
— a way to chain multiple operations together.
Package Size Optimization
v1.27.1 workflow updated
set.cartesianProduct() added
New features
- set
cartesianProduct()
cartesianProductAsync()
- Stream
cartesianProductWith()
- AsyncStream
cartesianProductWith()
infinite.cycle() added
New features
- infinite
cycle()
cycleAsync()
- Stream
ofCycle()
- AsyncStream
ofCycle()