
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.
validator-runner
Advanced tools
async form validator runner
yarn add validator-runner
import Validator from 'validator-runner';
const schema = {
name: [
{
validator: name => name,
message: 'Please input something!',
},
{
validator(name) {
return new Promise((res, rej) => {
setTimeout(() => {
name === 'loading' ? res(name) : rej(name);
}, 0);
});
},
message: name => `"${name}" is not my name!`,
},
],
birth: {
validator(date) {
return date === '1995';
},
message: 'Wrong Date!',
},
};
const validator = new Validator(schema);
validator.validateItem({ name: 'loading' }, 'name').then(data => {
// data:
// errors: an array of errors
// rule: the validation object that executed last
});
// or
validator.validateItem({ name: 'loading' }, 'name', (errors, data) => {
// errors: an array of errors
// data:
// errors: an array of errors
// rule: the validation object that executed last
});
⚠️⚠️⚠️
Note: All sync validators will be transformed to promises internally.
new Validator(schema, options)
option.first
default: true
. If true, every field will not stop validation at first failed rule
option.retention
default: false
. If true, the last pending validation will be not covered when a new validation begins
option.concurrent
default: false
. if true, all validator will be executed at the same time
validateItem(source, fieldName, callback})
object
The data to validatestring
The name of field to validatefunction(errors, data)
FAQs
Validate form asynchronous
The npm package validator-runner receives a total of 8 weekly downloads. As such, validator-runner popularity was classified as not popular.
We found that validator-runner 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.