Home / Function/ extract_paths() — svelte Function Reference

extract_paths() — svelte Function Reference

Architecture documentation for the extract_paths() function in ast.js from the svelte codebase.

Function javascript Compiler Migrator calls 1 called by 9

Entity Profile

Dependency Diagram

graph TD
  c254e734_2224_c309_f1f8_bb064e80b1af["extract_paths()"]
  0c5c28a7_226d_4e7c_e75e_0853c0a9fc2c["ast.js"]
  c254e734_2224_c309_f1f8_bb064e80b1af -->|defined in| 0c5c28a7_226d_4e7c_e75e_0853c0a9fc2c
  8f93b8d1_a873_5c72_eae3_de296245116a["instance_script.VariableDeclaration()"]
  8f93b8d1_a873_5c72_eae3_de296245116a -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  533f6c0a_5a99_4a6e_a54c_59fc0c845257["VariableDeclarator()"]
  533f6c0a_5a99_4a6e_a54c_59fc0c845257 -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  7271af10_6d98_1164_127d_943c5a469db9["EachBlock()"]
  7271af10_6d98_1164_127d_943c5a469db9 -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  728b667b_c247_1046_c8e0_e7df5177ae85["SnippetBlock()"]
  728b667b_c247_1046_c8e0_e7df5177ae85 -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  dbadea0c_9bb0_dd96_41bd_09a33169352f["VariableDeclaration()"]
  dbadea0c_9bb0_dd96_41bd_09a33169352f -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  887ad0a0_32ea_f4c0_1d78_fe0a6641e266["create_state_declarators()"]
  887ad0a0_32ea_f4c0_1d78_fe0a6641e266 -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  007c3954_38c0_485d_f93d_2da7aa34f6bc["VariableDeclaration()"]
  007c3954_38c0_485d_f93d_2da7aa34f6bc -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  1adb4ea4_d32e_0d06_3e3c_e359665c6f64["create_state_declarators()"]
  1adb4ea4_d32e_0d06_3e3c_e359665c6f64 -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  3f298b15_f3b3_11d6_21ea_d35e2d476f80["visit_assignment_expression()"]
  3f298b15_f3b3_11d6_21ea_d35e2d476f80 -->|calls| c254e734_2224_c309_f1f8_bb064e80b1af
  27987cb0_7747_fd10_c20f_fd6c1f1c37e2["_extract_paths()"]
  c254e734_2224_c309_f1f8_bb064e80b1af -->|calls| 27987cb0_7747_fd10_c20f_fd6c1f1c37e2
  style c254e734_2224_c309_f1f8_bb064e80b1af fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/utils/ast.js lines 243–258

export function extract_paths(param, initial) {
	/**
	 * When dealing with array destructuring patterns (`let [a, b, c] = $derived(blah())`)
	 * we need an intermediate declaration that creates an array, since `blah()` could
	 * return a non-array-like iterator
	 * @type {Array<{ id: ESTree.Identifier, value: ESTree.Expression }>}
	 */
	const inserts = [];

	/** @type {DestructuredAssignment[]} */
	const paths = [];

	_extract_paths(paths, inserts, param, initial, initial, false);

	return { inserts, paths };
}

Domain

Subdomains

Frequently Asked Questions

What does extract_paths() do?
extract_paths() is a function in the svelte codebase, defined in packages/svelte/src/compiler/utils/ast.js.
Where is extract_paths() defined?
extract_paths() is defined in packages/svelte/src/compiler/utils/ast.js at line 243.
What does extract_paths() call?
extract_paths() calls 1 function(s): _extract_paths.
What calls extract_paths()?
extract_paths() is called by 9 function(s): EachBlock, SnippetBlock, VariableDeclaration, VariableDeclaration, VariableDeclarator, create_state_declarators, create_state_declarators, instance_script.VariableDeclaration, and 1 more.

Analyze Your Own Codebase

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

Try Supermodel Free