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

express-params-checker

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-params-checker - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

9

index.js
const _ = require('lodash')
exports.has = (...requiredFields) => {
module.exports = (...requiredFields) => {
const checkFunc = (req) => {
let para = _.extend({}, req.query, req.body, req.params)
let parameters = _.extend({}, req.query, req.body, req.params)
for(let i = 0; i < requiredFields.length; i++){
if(!_.has(para, requiredFields[i])){
if(!_.has(parameters, requiredFields[i])){
let err = new Error(`Missing parameter: ${requiredFields[i]}`)

@@ -13,3 +13,4 @@ err.status = 400

}
req.para = para
req.parameters = parameters
req.data = parameters
}

@@ -16,0 +17,0 @@

{
"name": "express-params-checker",
"version": "1.0.4",
"version": "1.1.0",
"description": "",

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

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