Releases: jajaperson/iterable-utilities
Releases · jajaperson/iterable-utilities
NPM, flatten, fuse, and fromResults
Added
- NPM support 🎉
- Transformers
iter.flat()
(likeArray.prototype.flat
)iter.completeFlat()
for flattening an iterable completely.iter.fuse()
for ignoring values after and including the return.
- Generators
iter.create.fromResults()
for creating iterators directly from results
Range, arithmetic reducers, and effectors
Added
- Effectors
iter.forEach()
(likeArray.prototype.forEach
)iter.lazyObserver()
for observing each yielded value lazily.
- Generators
iter.create.range()
for creating an iterable over a range of numbers.
- Reducers
iter.sum()
for getting the sum of an iterable.iter.product()
for getting the product of an iterable.iter.norm()
for getting the vector norm of an iterable.
Improve naming conventions
Added
- Several types for
iter
functions.IterFunction
UniaryIterFunction
CurriedIterFunction
UniaryIterTransformer
- Documentation on chaining/composition.
Changed
- All documentation which previously referred to the functions of this library
as methods now says function.
FP version
Added
- An
IterableCircular
type for iterables using generator functions. - A alternative module with a sensible level of currying,
fp.ts
. This is also
exported ascurried
from the mainmod.ts
.
Changed
- Everything which used to return an
Iterable
now returns the
IterableCircular
type. This doesn't break anything because these types are
compatible.
Permanent iterables and better docs
Added
- Export
LICENSE
fromversion.ts
andmod.ts
- Transformers
iter.remember()
so that an iterable can be iterated over multiple times and
be guaranteed to yield the same results.
- Examples to documentation
Reusable iterables
Added
- Transformers
- Chunkify inspired by
@sindresorhus/chunkify
- Chunkify inspired by
Changed
- Everything which used to return the
IterableIterator
type now returns the
Iterable
type. This also means that returned iterables are not use-once. - Iterables are no longer stripped before being passed to callbacks.
First stable release 🎉
Maybe it was too soon.
Added
- Reducers
iter.find()
(likeArray.prototype.find
)iter.findIndex()
(likeArray.prototype.findIndex
)iter.includes()
(likeArray.prototype.includes
)
- Transformers
iter.filter()
(likeArray.prototype.filter
)iter.until()
to cut off an iterable when a predicate returns trueiter.indexedPairs
(likeArray.prototype.entries
)
Add reducers
Added
- More unit tests.
- Better documentation via TSDoc
- Reducers
iter.reduce()
(likeArray.prototype.reduce
)iter.some()
(likeArray.prototype.some
)iter.every()
(likeArray.prototype.every
)
- Generators
iter.create.increments()
to create an endless incremementing interator.
Changed
- Clear separation of internal API.
- Generators
- Old
iter.create.from()
is nowiter.create.endlessFrom()
.
iter.create.from()
now creates an iterator from a function returning
iterator result objects.
- Old
Fix bug in `iter.pair()`
Added
- Unit tests
Changed
iter.pair()
fixed so it doesn't just give the same value.
7 new utilities
Added
- Generators
iter.create.from()
for creating iterators from functions.iter.create.constant()
for creating an endless iterable of the same value.iter.create.randomNumbers()
for creating an endless iterable of
pseudorandom numbers.
- Transformers
iter.map()
(likeArray.prototype.map
)iter.take()
for taking the first n items of an iterable.
- Combinators
iter.pair()
for zipping two iterables.iter.concat
(likeArray.prototype.concat
)