Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-validate-schema

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-validate-schema - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

4

index.js

@@ -35,2 +35,6 @@ /*

custom (key, schema) {
return procRequest.bind(this, key, schema)
}
response (schema) {

@@ -37,0 +41,0 @@ return procResponse.bind(this, schema)

2

package.json
{
"name": "express-validate-schema",
"version": "2.1.0",
"version": "2.2.0",
"description": "a simple express middleware to validate the request/response objects (body, params, querystring and headers) againts an object schema with joi",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -44,2 +44,6 @@ # express-validate-schema

**validating a custom key in the req object**
`validateSchema([options]).custom('key', some joi schema)`
**validating response**

@@ -90,2 +94,13 @@

// validating the foobar custom req key
router.get(
'/custom/:foobar?',
(req, res, next) => {
req.foobar = req.params.foobar
next()
},
validateSchema({ processHttpCallOnError: true }).custom('foobar', customSchema),
(req, res) => { res.send('custom') }
)
// validating params, body and header

@@ -92,0 +107,0 @@ router.put(

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc