Home / Function/ trim_block() — svelte Function Reference

trim_block() — svelte Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  fd9e1483_8d98_1d09_da34_84b84cb1e057["trim_block()"]
  cab41022_1b55_3b7a_06c6_b90763bbea47["index.js"]
  fd9e1483_8d98_1d09_da34_84b84cb1e057 -->|defined in| cab41022_1b55_3b7a_06c6_b90763bbea47
  fc112414_6b48_d0db_90bb_c7858041984c["template.HtmlTag()"]
  fc112414_6b48_d0db_90bb_c7858041984c -->|calls| fd9e1483_8d98_1d09_da34_84b84cb1e057
  e9fa7627_08f7_5c2b_1fa8_4a64ea5c0271["template.ConstTag()"]
  e9fa7627_08f7_5c2b_1fa8_4a64ea5c0271 -->|calls| fd9e1483_8d98_1d09_da34_84b84cb1e057
  32f01c47_04ae_f9b8_b80d_3cc158dae8fd["template.IfBlock()"]
  32f01c47_04ae_f9b8_b80d_3cc158dae8fd -->|calls| fd9e1483_8d98_1d09_da34_84b84cb1e057
  d85ffc67_41c3_6b80_47f7_1c9403063163["template.AwaitBlock()"]
  d85ffc67_41c3_6b80_47f7_1c9403063163 -->|calls| fd9e1483_8d98_1d09_da34_84b84cb1e057
  2c9f412a_65a1_98a6_b149_3adc3638fefb["template.KeyBlock()"]
  2c9f412a_65a1_98a6_b149_3adc3638fefb -->|calls| fd9e1483_8d98_1d09_da34_84b84cb1e057
  style fd9e1483_8d98_1d09_da34_84b84cb1e057 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/migrate/index.js lines 1047–1053

function trim_block(state, start, end) {
	const original = state.str.snip(start, end).toString();
	const without_parens = original.substring(1, original.length - 1);
	if (without_parens.trim().length !== without_parens.length) {
		state.str.update(start + 1, end - 1, without_parens.trim());
	}
}

Domain

Subdomains

Frequently Asked Questions

What does trim_block() do?
trim_block() is a function in the svelte codebase, defined in packages/svelte/src/compiler/migrate/index.js.
Where is trim_block() defined?
trim_block() is defined in packages/svelte/src/compiler/migrate/index.js at line 1047.
What calls trim_block()?
trim_block() is called by 5 function(s): template.AwaitBlock, template.ConstTag, template.HtmlTag, template.IfBlock, template.KeyBlock.

Analyze Your Own Codebase

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

Try Supermodel Free