Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@metarhia/iterator
Advanced tools
@metarhia/iterator
- efficient and composable iteration$ npm install @metarhia/iterator
Returns: <Iterator>
Create iterator iterating over the range
iterators
: <Array>
Returns: <Iterator>
Create iterator by zipping multiple provided iterators into one
fn
: <Function>
this
: <Iterator>
Returns: the result of fn(this)
call.
Call a function with this
. Will be equivalent to calling fn(it)
.
fn
: <Function>
this
: <Iterator>
Returns: <Iterator>
result of fn(this)
wrapped in an Iterator.
Call a function with this
and wrap the result in an Iterator.
Example:
iter([1, 2])
.chainApply(([a, b]) => [a + b, a - b])
.join(', ');
Result:
'3, -1';
mapper
: <Function>
function that maps values and returns
either new value that will be the next value of the new iterator or
filterValue
that will be ignored.
value
: <any>
iterator elementthisArg
: <any>
value to be used as this
when calling mapper
filterValue
: <any>
value to filter out mapper
results.Creates an iterator that both filters and maps with the passed mapper
.
This iterator will call mapper
on each element and if mapper returns NOT
filterValue
it will be returned, otherwise it is ignored.
comparator
: <Function>
returns true
if new value should be
accepted
currValue
: <any>
current value, starts with undefinednextValue
: <any>
next value<boolean>
true
if next value should be acceptedaccessor
: <Function>
gets value to compare by, current
iterator value is used by default
value
: <any>
current iterator value<any>
value to compare bythisArg
: <any>
value to be used as this
when calling accessor
and
comparator
Returns: last iterator value where comparator
returned true
,
<undefined>
by default
Find value in this iterator by comparing every value with
the found one using comparator
classifier
: <Function>
gets value to group by
value
: <any>
current iterator value<any>
value to group bythisArg
: <any>
value to be used as this
when calling classifier
<Map>
map with arrays of iterator values grouped by keys
returned by classifier
Consumes an iterator grouping values by keys
accessor
: <Function>
gets value to compare by, current
iterator value is used by default
value
: <any>
current iterator value<any>
value to compare bythisArg
: <any>
value to be used as this
when calling accessor
Returns: element with maximum value or <undefined>
if iterator
is empty
Find the maximum value in this iterator
accessor
: <Function>
gets value to compare by, current
iterator value is used by default
value
: <any>
current iterator value<any>
value to compare bythisArg
: <any>
value to be used as this
when calling accessor
Returns: element with minimum value or <undefined>
if iterator
is empty
Find the minimum value in this iterator
predicate
: <Function>
function returns a value to partition
this iterator
thisArg
: <any>
value to be used as this
when calling predicate
<Array>
array of partitions (arrays), will always have
at least 2 arrays in itConsumes an iterator, partitioning it into Arrays
Transforms an iterator of key-value pairs into an object.
This is similar to what {Object.fromEntries()}
would offer.
base
: <Iterable>
|<AsyncIterable>
an iterable that is wrapped
in <AsyncIterator>
Returns: <AsyncIterator>
Create an AsyncIterator instance
See github for full contributors list
FAQs
Efficient and composable iteration
The npm package @metarhia/iterator receives a total of 11 weekly downloads. As such, @metarhia/iterator popularity was classified as not popular.
We found that @metarhia/iterator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.