Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@exanest/better-validation-pipe
Advanced tools
This pipe extends Nest's [built-in validation pipe](https://docs.nestjs.com/techniques/validation#using-the-built-in-validationpipe) and makes it a bit more descriptive.
This pipe extends Nest's built-in validation pipe and makes it a bit more descriptive.
The default validation pipe is great, but error it returns is just an array of errors:
{
"statusCode": 400,
"error": "Bad Request",
"message": ["email must be an email", "phone cannot be empty"]
}
This package changes the message
to be an object with field names as keys:
{
"statusCode": 400,
"error": "Bad Request",
"message": {
"email": ["email must be an email"],
"phone": ["phone cannot be empty"]
}
}
So then, on your frontend, you can show each error next to its relavant field, instead of showing all of them at the end of your form
On Yarn:
yarn add @exanest/better-validation-pipe
On NPM:
npm install @exanest/better-validation-pipe
This behavior is achievable by passing a custom exceptionFactory
to the original pipe, but I found myself writing the same exception factory for each one of my projects, so I made this small package.
This is the same way Laravel returns errors; as an object that contains arrays of errors (strings).
FAQs
This pipe extends Nest's [built-in validation pipe](https://docs.nestjs.com/techniques/validation#using-the-built-in-validationpipe) and makes it a bit more descriptive.
We found that @exanest/better-validation-pipe 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.