Home / Function/ as_tree() — svelte Function Reference

as_tree() — svelte Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3300d018_c33d_f853_eacf_f84c33c83c78["as_tree()"]
  e1ee663e_9a6d_c084_3617_f6741c138bb7["Template"]
  3300d018_c33d_f853_eacf_f84c33c83c78 -->|defined in| e1ee663e_9a6d_c084_3617_f6741c138bb7
  style 3300d018_c33d_f853_eacf_f84c33c83c78 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/3-transform/client/transform-template/template.js lines 76–83

	as_tree() {
		// if the first item is a comment we need to add another comment for effect.start
		if (this.nodes[0].type === 'comment') {
			this.nodes.unshift({ type: 'comment', data: undefined });
		}

		return b.array(this.nodes.map(objectify));
	}

Domain

Subdomains

Frequently Asked Questions

What does as_tree() do?
as_tree() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/3-transform/client/transform-template/template.js.
Where is as_tree() defined?
as_tree() is defined in packages/svelte/src/compiler/phases/3-transform/client/transform-template/template.js at line 76.

Analyze Your Own Codebase

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

Try Supermodel Free