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

@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.4 to 7.2.6

6

classes/email-address.js

@@ -58,7 +58,3 @@ 'use strict';

}
// Wrap name in quotes to address API issue
// https://github.com/sendgrid/sendgrid-csharp/issues/268#issuecomment-232177443
const isQuoted = (name[0] === '\"') && (name[name.length - 1] === '\"');
const shouldQuote = name.includes(',') && !isQuoted;
this.name = shouldQuote ? `\"${name}\"` : name;
this.name = name;
}

@@ -65,0 +61,0 @@

4

classes/email-address.spec.js

@@ -58,5 +58,5 @@ 'use strict';

it('should wrap name in quotes if a comma is present', function() {
it('should not wrap name in quotes if a comma is present', function() {
email.setName('Doe, John');
expect(email.name).to.equal('\"Doe, John\"');
expect(email.name).to.equal('Doe, John');
});

@@ -63,0 +63,0 @@

@@ -444,6 +444,6 @@ 'use strict';

}
if (!attachments.every(attachment => attachment.type && typeof attachment.type === 'string')) {
if (!attachments.every(attachment => !attachment.type || typeof attachment.type === 'string')) {
throw new Error('Expected the attachment\'s `type` field to be a string');
}
if (!attachments.every(attachment => attachment.disposition && typeof attachment.disposition === 'string')) {
if (!attachments.every(attachment => !attachment.disposition || typeof attachment.disposition === 'string')) {
throw new Error('Expected the attachment\'s `disposition` field to be a string');

@@ -450,0 +450,0 @@ }

@@ -13,4 +13,3 @@ 'use strict';

describe('Mail', function() {
describe('#527', function() {
describe('construct', function() {
it('shouldn\'t convert the headers to camel/snake case', function() {

@@ -44,4 +43,2 @@ const mail = new Mail({

});
});
describe('#689', function() {

@@ -68,2 +65,3 @@ it('should detect dynamic template id', function() {

});
it('should detect legacy template id', function() {

@@ -89,2 +87,3 @@ const mail = new Mail({

});
it('should ignore substitutions if templateId is dynamic', function() {

@@ -161,2 +160,35 @@ const mail = new Mail({

describe('attachments', () => {
it('handles multiple attachments', () => {
const mail = new Mail({
to: 'recipient@example.org',
attachments: [{
content: 'test-content',
filename: 'name-that-file',
type: 'file-type',
}, {
content: 'other-content',
filename: 'name-this-file',
disposition: 'inline',
}],
});
expect(mail.toJSON()['attachments']).to.have.a.lengthOf(2);
});
it('requires content', () => {
expect(() => new Mail({
attachments: [{
filename: 'missing content',
}],
})).to.throw('content');
});
it('requires filename', () => {
expect(() => new Mail({
attachments: [{
content: 'missing filename',
}],
})).to.throw('filename');
});
});
});

@@ -163,0 +195,0 @@

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

@@ -36,3 +36,3 @@ "contributors": [

},
"gitHead": "5b06b5d2e146e13a83f24945fd8650695789adc6"
"gitHead": "017fe1a56391cfe5d74c3d432881dbdc44287d41"
}
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