MCPcopy Index your code
hub / github.com/sendgrid/sendgrid-nodejs / setContent

Method setContent

packages/helpers/classes/mail.js:326–339  ·  view source on GitHub ↗

* Set content

(content)

Source from the content-addressed store, hash-verified

324 * Set content
325 */
326 setContent(content) {
327 if (this._doArrayCheck('content', content)) {
328 if (!content.every(contentField => typeof contentField === 'object')) {
329 throw new Error('Expected each entry in `content` to be an object');
330 }
331 if (!content.every(contentField => typeof contentField.type === 'string')) {
332 throw new Error('Expected each `content` entry to contain a `type` string');
333 }
334 if (!content.every(contentField => typeof contentField.value === 'string')) {
335 throw new Error('Expected each `content` entry to contain a `value` string');
336 }
337 this.content = content;
338 }
339 }
340
341 /**
342 * Add content

Callers 2

fromDataMethod · 0.95
attachment.spec.jsFile · 0.45

Calls 1

_doArrayCheckMethod · 0.95

Tested by

no test coverage detected