Home / Function/ is_customizable_select_element() — svelte Function Reference

is_customizable_select_element() — svelte Function Reference

Architecture documentation for the is_customizable_select_element() function in nodes.js from the svelte codebase.

Function javascript Compiler Transformer calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  02aa96ac_ad32_58cd_41f5_e0ee1020af5f["is_customizable_select_element()"]
  bbca3d2a_42c8_b215_d3b5_5077ccaf0797["nodes.js"]
  02aa96ac_ad32_58cd_41f5_e0ee1020af5f -->|defined in| bbca3d2a_42c8_b215_d3b5_5077ccaf0797
  874d992f_5e60_ebce_f4ce_ea5fed014bc4["RegularElement()"]
  874d992f_5e60_ebce_f4ce_ea5fed014bc4 -->|calls| 02aa96ac_ad32_58cd_41f5_e0ee1020af5f
  1e3b81f2_cd53_e5a5_0140_a9af38facf99["RegularElement()"]
  1e3b81f2_cd53_e5a5_0140_a9af38facf99 -->|calls| 02aa96ac_ad32_58cd_41f5_e0ee1020af5f
  602abe50_d235_587e_7077_a4250fe9dc79["RegularElement()"]
  602abe50_d235_587e_7077_a4250fe9dc79 -->|calls| 02aa96ac_ad32_58cd_41f5_e0ee1020af5f
  d0be0ead_0b19_a473_e266_d33ce595c91b["find_descendants()"]
  02aa96ac_ad32_58cd_41f5_e0ee1020af5f -->|calls| d0be0ead_0b19_a473_e266_d33ce595c91b
  style 02aa96ac_ad32_58cd_41f5_e0ee1020af5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/nodes.js lines 174–206

export function is_customizable_select_element(node) {
	if (node.name === 'select' || node.name === 'optgroup' || node.name === 'option') {
		for (const child of find_descendants(node.fragment)) {
			if (child.type === 'RegularElement') {
				if (node.name === 'select' && child.name !== 'option' && child.name !== 'optgroup') {
					return true;
				}

				if (node.name === 'optgroup' && child.name !== 'option') {
					return true;
				}

				if (node.name === 'option') {
					return true;
				}
			}

			// Text nodes directly in <select> or <optgroup> are rich content
			else if (child.type === 'Text') {
				if (node.name === 'select' || node.name === 'optgroup') {
					return true;
				}
			}

			// Any non-RegularElement, non-Text node is rich content
			else {
				return true;
			}
		}
	}

	return false;
}

Domain

Subdomains

Frequently Asked Questions

What does is_customizable_select_element() do?
is_customizable_select_element() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/nodes.js.
Where is is_customizable_select_element() defined?
is_customizable_select_element() is defined in packages/svelte/src/compiler/phases/nodes.js at line 174.
What does is_customizable_select_element() call?
is_customizable_select_element() calls 1 function(s): find_descendants.
What calls is_customizable_select_element()?
is_customizable_select_element() is called by 3 function(s): RegularElement, RegularElement, RegularElement.

Analyze Your Own Codebase

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

Try Supermodel Free