Socket
Socket
Sign inDemoInstall

@sendgrid/helpers

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sendgrid/helpers - npm Package Compare versions

Comparing version 7.2.6 to 7.3.0

23

classes/response-error.js
'use strict';
/**
* Dependencies
*/
const chalk = require('chalk');
/**
* Response error class

@@ -22,3 +17,3 @@ */

//Extract data from response
const {headers, status, statusText, data} = response;
const { headers, status, statusText, data } = response;

@@ -28,3 +23,3 @@ //Set data

this.message = statusText;
this.response = {headers, body: data};
this.response = { headers, body: data };

@@ -45,9 +40,9 @@ //Capture stack trace

toString() {
const {body} = this.response;
let err = chalk.red(`${this.message} (${this.code})`);
const { body } = this.response;
let err = `${this.message} (${this.code})`;
if (body && Array.isArray(body.errors)) {
body.errors.forEach(error => {
const message = chalk.yellow(error.message);
const field = chalk.grey(error.field);
const help = chalk.grey(error.help);
const message = error.message;
const field = error.field;
const help = error.help;
err += `\n ${message}\n ${field}\n ${help}`;

@@ -63,4 +58,4 @@ });

toJSON() {
const {message, code, response} = this;
return {message, code, response};
const { message, code, response } = this;
return { message, code, response };
}

@@ -67,0 +62,0 @@ }

{
"name": "@sendgrid/helpers",
"description": "Twilio SendGrid NodeJS internal helpers",
"version": "7.2.6",
"version": "7.3.0",
"author": "Twilio SendGrid <help@twilio.com> (sendgrid.com)",

@@ -33,6 +33,5 @@ "contributors": [

"dependencies": {
"chalk": "^2.0.1",
"deepmerge": "^4.2.2"
},
"gitHead": "017fe1a56391cfe5d74c3d432881dbdc44287d41"
"gitHead": "59f6cffc3d45e702ec81212238bae7bf0d704841"
}
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