* Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string. * @param {AccumulatedContent} content * @returns {AccumulatedContent}
(content = { head: '', body: '' })
| 676 | * @returns {AccumulatedContent} |
| 677 | */ |
| 678 | #collect_content(content = { head: '', body: '' }) { |
| 679 | for (const item of this.#out) { |
| 680 | if (typeof item === 'string') { |
| 681 | content[this.type] += item; |
| 682 | } else if (item instanceof Renderer) { |
| 683 | item.#collect_content(content); |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | return content; |
| 688 | } |
| 689 | |
| 690 | /** |
| 691 | * Collect all of the code from the `out` array and return it as a string. |