MCPcopy
hub / github.com/sveltejs/svelte / #collect_content

Method #collect_content

packages/svelte/src/internal/server/renderer.js:678–688  ·  view source on GitHub ↗

* 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: '' })

Source from the content-addressed store, hash-verified

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.

Callers 3

optionMethod · 0.95
titleMethod · 0.95
#renderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected