Socket
Socket
Sign inDemoInstall

req-requires

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

6

lib/req-requires.js

@@ -19,9 +19,5 @@ var requiredProperty = require('./requiredProperty');

this.property = function(name){
return new requiredProperty(this, name);
return new requiredProperty(req, name);
}
this.getValue = function(propertyName){
return getPropertyValue(req, propertyName);
}
this.fail = function(message){

@@ -28,0 +24,0 @@ this.error = message;

2

package.json
{
"name": "req-requires",
"version": "0.0.4",
"version": "0.0.5",
"description": "Add assertions to ExpressJS middleware",

@@ -5,0 +5,0 @@ "main": "./lib/req-requires.js",

@@ -32,2 +32,20 @@ **req-requires.js** is a library that is used to validate properties on the request object in expressjs route handlers.

***Example of a failing request***
```
Example Request:
GET: http://localhost:3000/testRoute
Example Response
400: Expected query.name to exist
```
***Example of a passing request***
```
Example Request:
GET: http://localhost:3000/testRoute?name=brandon
Example Response
200: Hello brandon!
```
### Validators

@@ -34,0 +52,0 @@ ```javascript

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc