
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
functor-iterable
Advanced tools
functor-iterable exports a class that builds iterables that provide map method.
$ npm install functor-iterable --save
const FunctorIterable = require('functor-iterable')
const iterable = new FunctorIterable([4, 2, 7, 8]) // (4 2 7 8)
.map(e => 3 * e) // (12 6 21 24)
.map(e => e / 2) // (6 3 10.5 12)
// converting to array:
[...iterable] // [6, 3, 10.5, 12]
// traversing values:
for (const val of iterable) {
// ...
}
// creating an iterator that traverses the values
let iterator = iterable[Symbol.iterator]()
iterator.next() // {value: 6, done: false}
iterator.next() // {value: 3, done: false}
iterator.next() // {value: 10.5, done: false}
iterator.next() // {value: 12, done: false}
iterator.next() // {value: undefined, done: true}
// Infinite iterable
const naturals = {
[Symbol.iterator]: function* () {
let i = 1
while(true) { yield i++ }
}
} // (1 2 3 4...)
const collatzTransform = e => e % 2 === 1 ? 3 * e + 1 : e / 2
new FunctorIterable(naturals) // (1 2 3 4 5...)
.map(collatzTransform) // (4 1 10 2 16...)
.map(collatzTransform) // (2 4 5 1 8...)
.map(collatzTransform) // (1 2 16 4 4...)
.map(collatzTransform) // (4 1 8 2 2...)
.map(collatzTransform) // (2 4 4 1 1...)
MIT
FAQs
Iterable that implements optimized map method
We found that functor-iterable 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.