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.8 to 0.0.9

3

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

@@ -16,2 +16,3 @@ "main": "./lib/req-requires.js",

"validation",
"assert",
"http",

@@ -18,0 +19,0 @@ "validate",

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

```javascript
req.requires.property('auth_provider').toExist();
req.requires.property('body.email').toExist();
req.requires.property('params.id').toMatch(/^[0-9a-fA-F]{24}$/);
toExist - the given property must exist in the request object
toBeType - the property must match the given type
toMatch - the property matches the given regex
toBeIn - the property is a member of the given array
```

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