
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.
array.prototype.groupby
Advanced tools
An ESnext spec-compliant `Array.prototype.groupBy` shim/polyfill/replacement that works as far down as ES3.
An ESnext spec-compliant Array.prototype.groupBy
shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.
Because Array.prototype.groupBy
depends on a receiver (the this
value), the main export takes the array to operate on as the first argument.
npm install --save array.prototype.groupby
var groupBy = require('array.prototype.groupby');
var assert = require('assert');
var arr = [0, 1, 2, 3, 4, 5];
var parity = function (x) { return x % 2 === 0 ? 'even' : 'odd'; };
var results = groupBy(arr, function (x, i, a) {
assert.equal(x, arr[i]);
assert.equal(a, arr);
return parity(x);
});
assert.deepEqual(results, {
__proto__: null,
even: [0, 2, 4],
odd: [1, 3, 5],
});
var groupBy = require('array.prototype.groupby');
var assert = require('assert');
/* when Array#groupBy is not present */
delete Array.prototype.groupBy;
var shimmed = groupBy.shim();
assert.equal(shimmed, groupBy.getPolyfill());
assert.deepEqual(arr.groupBy(parity), groupBy(arr, parity));
var groupBy = require('array.prototype.groupby');
var assert = require('assert');
/* when Array#groupBy is present */
var shimmed = groupBy.shim();
assert.equal(shimmed, Array.prototype.groupBy);
assert.deepEqual(arr.groupBy(parity), groupBy(arr, parity));
Simply clone the repo, npm install
, and run npm test
FAQs
An ESnext spec-compliant `Array.prototype.groupBy` shim/polyfill/replacement that works as far down as ES3.
We found that array.prototype.groupby 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.