
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@pinemach/obj-permute
Advanced tools
@pinemach/obj-permute is a small JavaScript package which can be used to iterate the list of objects representing every combination of attribute values as specified by an input object whose attributes refer to lists of possible values.
You can read the full API documentation at pineapplemachine.github.io/obj-permute-js/.
You can install this package with the package manager of your choice. For example,
npm install @pinemach/obj-permute
You can then import and use the module like so:
// CommonJS
const getObjectPermutations = require("@pinemach/obj-permute").getObjectPermutations;
// ES6 modules
import getObjectPermutations from "@pinemach/obj-permute";
This package exports the getObjectPermutations function, which accepts an object whose attributes associate keys with lists of values.
The function returns an iterator which enumerates objects representing every combination of attribute values within those lists.
For example, the states object input {x: [0, 1], y: [2, 3]}
corresponds
to the list of permutations containing the objects
{x: 0, y: 2}
, {x: 1, y: 2}
, {x: 0, y: 3}
, and {x: 1, y: 3}
.
import getObjectPermutations from "@pinemach/obj-permute";
// Get an iterator for every combination of attribute values
const permutations = getObjectPermutations({
x: [0, 1],
y: [2, 3],
});
// Get an array from that iterator
const permutationsArray = permutations.array();
// Verify that each expected item is present
assert(permutationsArray.length === 4);
assert(permutationsArray.find(
result => result.x === 0 && result.y === 2
));
assert(permutationsArray.find(
result => result.x === 1 && result.y === 2
));
assert(permutationsArray.find(
result => result.x === 0 && result.y === 3
));
assert(permutationsArray.find(
result => result.x === 1 && result.y === 3
));
FAQs
Iterate permutations described by a states object.
The npm package @pinemach/obj-permute receives a total of 0 weekly downloads. As such, @pinemach/obj-permute popularity was classified as not popular.
We found that @pinemach/obj-permute 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.