
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
run useful tests on your arrays or hashes of arrays or hashes
var test = require('testover');
test.max('length').over(someArray); //run your tests inline
var samelength = test.equals('length'); //or set up a testing function to call later
samelength(someArray);
triplets: [
{name: 'Joe', age: 20}
, {name: 'Josie', age: 20}
, {name: 'Johnny', age: 20}
]
test.consistent('age').over(triplets);
test.equals('age', 20).over(triplets);
assoc_triplets: {
first: {name: 'Joe', age: 20}
, second: {name: 'Josie', age: 20}
, third: {name: 'Johnny', age: 20}
}
test.consistent('age').over(assoc_triplets);
test.equals('age', 20).over(assoc_triplets);
The underlying process is essentially a fancy reduce function. With this in mind you can add your own reductions to do even more testing.
tests.add(* *<field name>, * *<reduction function>, * *<options object>)
Reductions take the form r(property, row, reduced, opts)
where
property
is the property passed to the new test
row
is the object or array currently being tested
reduced
is the variable being reduced (the variable that will be returned)
opts
is an object with extra goodies you can pass between iterations of your reduction
You can assign an initial value by assigning opts.init
when you add the new reduction, otherwise opts.init
and opts.first
are assigned to the first list item's value.
test.add('noConsecutiveRepeats', function(prop, row, repeats, opts) {
var current = row[prop];
if (current === opts.previous) {
return false
} else {
opts.previous = current;
return repeats;
}
}, {init: true, previous: undefined});
test.noConsecutiveRepeats('property').over(array);
MIT
FAQs
run useful tests on your arrays or hashes of arrays or hashes
We found that test-over 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.