Socket
Socket
Sign inDemoInstall

configurapi-handler-json

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

configurapi-handler-json - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

2

package.json
{
"name": "configurapi-handler-json",
"version": "1.0.8",
"version": "1.0.9",
"description": "Configurapi request handlers for JSON requests/responses",

@@ -5,0 +5,0 @@ "main": "src/index",

@@ -9,2 +9,3 @@ const Ajv = require('ajv');

let error = undefined;
let errorDetails = undefined;

@@ -16,2 +17,8 @@ try

isValid = validator.validate(schema, data);
if(isValid === false)
{
error = validator.errorsText();
errorDetails = validator.errors;
}
}

@@ -23,3 +30,3 @@ catch(e)

callback(error, isValid);
callback(error, errorDetails, isValid);
}

@@ -41,3 +48,3 @@

{
validate(schemaText, event.payload, (error, isValid) =>
validate(schemaText, event.payload, (error, errorDetails, isValid) =>
{

@@ -50,3 +57,3 @@ if(isValid)

{
event.response = new ErrorResponse(error || 'Bad request', 400)
event.response = new ErrorResponse(error || 'Bad request', 400, errorDetails);
this.complete();

@@ -53,0 +60,0 @@ }

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