Home / Function/ template.SvelteElement() — svelte Function Reference

template.SvelteElement() — svelte Function Reference

Architecture documentation for the template.SvelteElement() function in index.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  efe8c251_8c53_8933_be63_87752f930714["template.SvelteElement()"]
  cab41022_1b55_3b7a_06c6_b90763bbea47["index.js"]
  efe8c251_8c53_8933_be63_87752f930714 -->|defined in| cab41022_1b55_3b7a_06c6_b90763bbea47
  cdc1fb24_8bb0_cade_bc99_13f6efb7c385["migrate_slot_usage()"]
  efe8c251_8c53_8933_be63_87752f930714 -->|calls| cdc1fb24_8bb0_cade_bc99_13f6efb7c385
  24f461f2_c717_3a18_d33f_adb48a448ef4["handle_events()"]
  efe8c251_8c53_8933_be63_87752f930714 -->|calls| 24f461f2_c717_3a18_d33f_adb48a448ef4
  style efe8c251_8c53_8933_be63_87752f930714 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/migrate/index.js lines 1113–1137

	SvelteElement(node, { state, path, next }) {
		migrate_slot_usage(node, path, state);
		if (node.tag.type === 'Literal') {
			let is_static = true;

			let a = /** @type {number} */ (node.tag.start);
			let b = /** @type {number} */ (node.tag.end);
			let quote_mark = state.str.original[a - 1];

			while (state.str.original[--a] !== '=') {
				if (state.str.original[a] === '{') {
					is_static = false;
					break;
				}
			}

			if (is_static && state.str.original[b] === quote_mark) {
				state.str.prependLeft(a + 1, '{');
				state.str.appendRight(/** @type {number} */ (node.tag.end) + 1, '}');
			}
		}

		handle_events(node, state);
		next();
	},

Domain

Subdomains

Frequently Asked Questions

What does template.SvelteElement() do?
template.SvelteElement() is a function in the svelte codebase, defined in packages/svelte/src/compiler/migrate/index.js.
Where is template.SvelteElement() defined?
template.SvelteElement() is defined in packages/svelte/src/compiler/migrate/index.js at line 1113.
What does template.SvelteElement() call?
template.SvelteElement() calls 2 function(s): handle_events, migrate_slot_usage.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free