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

Method #close_render

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

* @param {AccumulatedContent} content * @param {Renderer} renderer * @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }}

(content, renderer)

Source from the content-addressed store, hash-verified

801 * @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }}
802 */
803 static #close_render(content, renderer) {
804 for (const cleanup of renderer.#collect_on_destroy()) {
805 cleanup();
806 }
807
808 let head = content.head + renderer.global.get_title();
809 let body = content.body;
810
811 for (const { hash, code } of renderer.global.css) {
812 head += `<style id="${hash}">${code}</style>`;
813 }
814
815 return {
816 head,
817 body,
818 hashes: {
819 script: renderer.global.csp.script_hashes
820 }
821 };
822 }
823
824 /**
825 * @param {HydratableContext} ctx

Callers 2

#renderMethod · 0.80
#render_asyncMethod · 0.80

Calls 3

cleanupFunction · 0.85
#collect_on_destroyMethod · 0.80
get_titleMethod · 0.80

Tested by

no test coverage detected