
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.
Anyone contains a small group of functions that check whether a number of given expressions evaluate to be truthy based on the number of times a truthy value appears.
Anyone has four functions:
any
- Checks that at least one of the supplied expressions evaluates to true.one
- Checks that only one of the supplied expressions evaluates to true (Mutual exclusion).all
- Checks that all of the supplied expressions evaluate to true.none
- Checks that none of the supplied expressions evaluates to true.They all accept any amount of arguments, or no arguments at all. If a function is passed, it will be run and its value will be evaluated. Return value is always a boolean.
All functions other than one
will short circuit when realizing the condition is not met.
In most cases (other than one
) you can do just fine using Array.prototype.some
and Array.prototype.every
, some of these functions are used internally by Vest.
if (one(var1, var2, var3)) {
// will reach here if ONLY ONE of the arguments is true
}
all(
validateInput1, // returns true
validateInput2, // returns false
validateInput3, // no need to run this, we already know our validation failed
);
npm i anyone
yarn add anyone
import { any, one, all, none } from 'anyone';
import any from 'anyone/any';
import one from 'anyone/one';
import none from 'anyone/none';
import all from 'anyone/all';
any(
someFunction, // evaluates to false
1,
someVar, // truthy
);
// true
// --------
any(
someFunction, // evaluates to false
0,
someVar, // falsy
);
// false
// --------
one(
someFunction, // evaluates to false
0,
someVar, // truthy
);
// true
// --------
none(
someFunction, // evaluates to false
1,
someVar, // truthy
);
// false
// --------
none(
someFunction, // evaluates to false
0,
someVar, // falsy
);
// true
// --------
all(
someFunction, // evaluates to false
0,
someVar, // truthy
);
// false
// --------
all(
someFunction, // evaluates to true
1,
someVar, // truthy
);
// true
FAQs
Unknown package
The npm package anyone receives a total of 247 weekly downloads. As such, anyone popularity was classified as not popular.
We found that anyone demonstrated a healthy version release cadence and project activity because the last version was released less than 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.