
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
mekanika-utils-each
Advanced tools
Functional style immutable collection iterator `each( fn, collection )`
Functional style immutable collection iterator.
Install with npm:
$ npm install mekanika-utils-each
Or install with component(1):
$ component install mekanika/utils-each
Applies a function to a collection (either an Object
or Array
) and returns the unmodified collection.
each( iteratorFn, collection );
iteratorFn
{Function} Called for each element in the collection. Receives params:
value
{Mixed} The value of the current element in the collectionindex
{Number|String} Current index, Number for array, String for objectcollection
{Object|Array} A reference to the collection being iteratedcollection
{Object|Array} The collection to be iterated
collection
{Object|Array} A reference to the original collectionUsing node:
var each = require('mekanika-utils-each');
To use in a browser:
$ make component
and then include as:
<script src="build/mekanika-utils-each.min.js"></script>
Iterating arrays:
each( function(v) { console.log( v*3 ) }, [1,2,3] );
// 3
// 6
// 9
// -> [1,2,3]
Iterating object properties:
each( function(v) { console.log( v*2 ) }, {a:2,b:3,c:4} );
// 4
// 6
// 8
// -> {a:2,b:3,c:4}
Functional style: partial application and subsequent calling:
var logSqrt = each( function(v) { console.log( Math.sqrt(v) ) } );
logSqrt( [1,2,3] );
// 1
// 1.41421...
// 1.73205...
// -> [1,2,3]
MIT
FAQs
Functional style immutable collection iterator `each( fn, collection )`
We found that mekanika-utils-each 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
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.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.