
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
mekanika-utils-map
Advanced tools
Functional style map iterator map( fn, collection [, this] )
A standard map iterator for Objects and Arrays:
collection
fn( value )
Main difference is that it flips traditional map
parameters around to
support currying, for partial application of mutator functions for mapping:
var square = map( function(v) { return v*v; } );
// -> {Function} (partially applied map)
square( [1,2,3] );
// -> [1,4,9]
Install with npm:
$ npm install mekanika-utils-map
Install with component(1):
$ component install mekanika/utils-map
map( mutatorFn, collection [, thisBinding] );
mutatorFn
{Function} Called for each element of collection. Passed:
value
{Mixed} The value of the current iterator elementindex
_{Number|String} The element index (Number for array, String for Object)collection
{Object|Array}collection
{Object|Array} The collection of elements to iterate
thisBinding
(*) Optional this
binding for the mutatorFn callback
modifiedCollection
{Object|Array} The mutated collection of elementsFor node:
var map = require('mekanika-utils-map');
For use in a browser, first build the file:
$ make component
Then include
<script src="build/mekanika-utils-map.js">
Arrays and objects:
map( function(v) { return v*v; }, [1,2,3] );
// -> [1,4,9]
map( function(v) { return v+5 }, {a:1, b:2, c:3} );
// -> [6,7,8]
Functional programming partial application:
var square = map( function(v) { return v*v; } );
// -> {Function} (partially applied map)
square( [1,2,3] );
// -> [1,4,9]
MIT
FAQs
Functional style map iterator `map( fn, collection )`
We found that mekanika-utils-map 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.