Home / Function/ get_global_keypath() — svelte Function Reference

get_global_keypath() — svelte Function Reference

Architecture documentation for the get_global_keypath() function in scope.js from the svelte codebase.

Function javascript Compiler Transformer calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  ba561e41_fdf9_83e5_4af2_dc4ce1c21987["get_global_keypath()"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305["scope.js"]
  ba561e41_fdf9_83e5_4af2_dc4ce1c21987 -->|defined in| ee93d8a6_6fde_b1c1_e15b_3a4da5326305
  f210eacb_3b9d_eacc_7972_c1f662fc4971["constructor()"]
  f210eacb_3b9d_eacc_7972_c1f662fc4971 -->|calls| ba561e41_fdf9_83e5_4af2_dc4ce1c21987
  bed91719_d047_2256_e199_ee875d5f49b9["get_rune()"]
  bed91719_d047_2256_e199_ee875d5f49b9 -->|calls| ba561e41_fdf9_83e5_4af2_dc4ce1c21987
  627dc2f8_4dbc_5bb1_8f54_cee503e17098["get()"]
  ba561e41_fdf9_83e5_4af2_dc4ce1c21987 -->|calls| 627dc2f8_4dbc_5bb1_8f54_cee503e17098
  style ba561e41_fdf9_83e5_4af2_dc4ce1c21987 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/scope.js lines 1397–1420

function get_global_keypath(node, scope) {
	let n = node;

	let joined = '';

	while (n.type === 'MemberExpression') {
		if (n.computed) return null;
		if (n.property.type !== 'Identifier') return null;
		joined = '.' + n.property.name + joined;
		n = n.object;
	}

	if (n.type === 'CallExpression' && n.callee.type === 'Identifier') {
		joined = '()' + joined;
		n = n.callee;
	}

	if (n.type !== 'Identifier') return null;

	const binding = scope.get(n.name);
	if (binding !== null) return null; // rune name, but references a variable or store

	return n.name + joined;
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does get_global_keypath() do?
get_global_keypath() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/scope.js.
Where is get_global_keypath() defined?
get_global_keypath() is defined in packages/svelte/src/compiler/phases/scope.js at line 1397.
What does get_global_keypath() call?
get_global_keypath() calls 1 function(s): get.
What calls get_global_keypath()?
get_global_keypath() is called by 2 function(s): constructor, get_rune.

Analyze Your Own Codebase

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

Try Supermodel Free