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

Method setCategories

packages/helpers/classes/mail.js:407–421  ·  view source on GitHub ↗

* Set categories

(categories)

Source from the content-addressed store, hash-verified

405 * Set categories
406 */
407 setCategories(categories) {
408 let allElementsAreStrings = (propertyName, value) => {
409 if (!Array.isArray(value) || !value.every(item => typeof item === 'string')) {
410 throw new Error('Array of strings expected for `' + propertyName + '`');
411 }
412 };
413
414 if (typeof categories === 'string') {
415 categories = [categories];
416 }
417
418 if (this._checkProperty('categories', categories, [this._checkUndefined, allElementsAreStrings])) {
419 this.categories = categories;
420 }
421 }
422
423 /**
424 * Add category

Callers 1

fromDataMethod · 0.95

Calls 1

_checkPropertyMethod · 0.95

Tested by

no test coverage detected