MCPcopy
hub / github.com/sveltejs/svelte / close

Method close

packages/svelte/src/internal/server/renderer.js:362–377  ·  view source on GitHub ↗
(renderer, value, { head, body })

Source from the content-addressed store, hash-verified

360 * @param {{ head?: string, body: any }} content
361 */
362 const close = (renderer, value, { head, body }) => {
363 if (has_own_property.call(attrs, 'value')) {
364 value = attrs.value;
365 }
366
367 if (value === this.local.select_value) {
368 renderer.#out.push(' selected=""');
369 }
370
371 renderer.#out.push(`>${body}${is_rich ? '<!>' : ''}</option>`);
372
373 // super edge case, but may as well handle it
374 if (head) {
375 renderer.head((child) => child.push(head));
376 }
377 };
378
379 if (typeof body === 'function') {
380 this.child((renderer) => {

Callers 5

bundleFunction · 0.80
test.tsFile · 0.80
run_testFunction · 0.80

Calls 3

pushMethod · 0.80
headMethod · 0.80
set_titleMethod · 0.80

Tested by

no test coverage detected