* Set content
(content)
| 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 |
no test coverage detected