![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@aloreljs/awesome-iter
Advanced tools
Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.
Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.
npm install @aloreljs/awesome-iter
Arrays have useful functions, iterables don't. While you could just transform an iterable into an array, that results in multiple iterations:
const someSet: Set<string> = getSomeSet();
const uppercased: Set<string> = new Set(
[...someSet] // first full iteration
.filter(str => str !== 'foo') // second full iteration
.map(str => str.toUpperCase()) // third, partial iteration
); // fourth partial iteration to construct the Set
This library allows you to work with iterables directly:
import {AwesomeIter} from '@aloreljs/awesome-iter';
import {concat, filter, map} from '@aloreljs/awesome-iter/pipes';
import {toSet} from '@aloreljs/awesome-iter/consumers';
const someSet: Set<string> = getSomeSet();
const someMap: Map<number, string> = getSomeMap();
const someArray: string[] = getSomeArray();
// Only 1 iteration over someSet, someMap & someArray
const uppercasedSet: Set<string> = new AwesomeIter(someSet)
.pipe(
concat(someMap.values(), someArray),
filter(str => str !== 'foo'),
map(str => str.toUpperCase()) // Only gets called `length - numberOfFoos` times
)
.collect(toSet()); // Set is populated as values get yielded
Just pass an Iterable
or Iterator
and AwesomeIter
will be able to start managing it.
Pipes manipulate the source Iterable
or Iterator
in some way - filter results, map them to different values etc.
Each pipe has documentation & examples written for it in the
projects/awesome-iter/pipes
directory and is imported from @aloreljs/awesome-iter/pipes
, e.g.
import {filter} from '@aloreljs/awesome-iter/pipes';
The current list of pipes is as follows:
chunk
concat
distinct
filter
map
sequentiallyDistinct
skip
take
tap
Consumers consume the source Iterable
or Iterator
& produce a single result - these include functions like those
in Array.prototype
that don't necessarily return an array & functions for collecting the source into some JS
collection. Each consumer has documentation & examples written for it in the
projects/awesome-iter/consumers
directory and is imported from @aloreljs/awesome-iter/consumers
, e.g.
import {some} from '@aloreljs/awesome-iter/consumers';
The current list of consumers is as follows:
count
find
first
includes
last
reduce
some
split
toArray
toMap
toObject
toSet
FAQs
Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.
We found that @aloreljs/awesome-iter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.