Home / Function/ get_static_value() — svelte Function Reference

get_static_value() — svelte Function Reference

Architecture documentation for the get_static_value() function in options.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  757b376c_e0ea_2ff2_dae4_3fc2ecf04509["get_static_value()"]
  09b07d2e_2631_ce6a_e899_0be23871c668["options.js"]
  757b376c_e0ea_2ff2_dae4_3fc2ecf04509 -->|defined in| 09b07d2e_2631_ce6a_e899_0be23871c668
  6a48e790_0ca5_6fae_197c_7c93c49d9b66["read_options()"]
  6a48e790_0ca5_6fae_197c_7c93c49d9b66 -->|calls| 757b376c_e0ea_2ff2_dae4_3fc2ecf04509
  59e343be_b026_cc21_f747_3fd70165bf25["get_boolean_value()"]
  59e343be_b026_cc21_f747_3fd70165bf25 -->|calls| 757b376c_e0ea_2ff2_dae4_3fc2ecf04509
  style 757b376c_e0ea_2ff2_dae4_3fc2ecf04509 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/1-parse/read/options.js lines 202–219

function get_static_value(attribute) {
	const { value } = attribute;

	if (value === true) return true;

	const chunk = Array.isArray(value) ? value[0] : value;

	if (!chunk) return true;
	if (value.length > 1) {
		return null;
	}
	if (chunk.type === 'Text') return chunk.data;
	if (chunk.expression.type !== 'Literal') {
		return null;
	}

	return chunk.expression.value;
}

Domain

Subdomains

Frequently Asked Questions

What does get_static_value() do?
get_static_value() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/1-parse/read/options.js.
Where is get_static_value() defined?
get_static_value() is defined in packages/svelte/src/compiler/phases/1-parse/read/options.js at line 202.
What calls get_static_value()?
get_static_value() is called by 2 function(s): get_boolean_value, read_options.

Analyze Your Own Codebase

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

Try Supermodel Free