get_possible_nested_siblings() — svelte Function Reference
Architecture documentation for the get_possible_nested_siblings() function in css-prune.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD 14568a03_9aaf_6654_12a2_6715c1feb40f["get_possible_nested_siblings()"] cb1bf043_dade_7352_cc2b_976ffa2968d8["css-prune.js"] 14568a03_9aaf_6654_12a2_6715c1feb40f -->|defined in| cb1bf043_dade_7352_cc2b_976ffa2968d8 d5d7e4cd_440a_0f1d_4f04_04a2cabd1beb["get_possible_element_siblings()"] d5d7e4cd_440a_0f1d_4f04_04a2cabd1beb -->|calls| 14568a03_9aaf_6654_12a2_6715c1feb40f f1ba25ad_bb71_e826_ea99_c51b13d5cd8b["loop_child()"] f1ba25ad_bb71_e826_ea99_c51b13d5cd8b -->|calls| 14568a03_9aaf_6654_12a2_6715c1feb40f f1ba25ad_bb71_e826_ea99_c51b13d5cd8b["loop_child()"] 14568a03_9aaf_6654_12a2_6715c1feb40f -->|calls| f1ba25ad_bb71_e826_ea99_c51b13d5cd8b 72641a2e_b8fc_984b_8f67_3250d77a3ede["has_definite_elements()"] 14568a03_9aaf_6654_12a2_6715c1feb40f -->|calls| 72641a2e_b8fc_984b_8f67_3250d77a3ede 69fc97cc_09aa_8b84_a7ce_425c1db8c339["add_to_map()"] 14568a03_9aaf_6654_12a2_6715c1feb40f -->|calls| 69fc97cc_09aa_8b84_a7ce_425c1db8c339 style 14568a03_9aaf_6654_12a2_6715c1feb40f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js lines 1010–1069
function get_possible_nested_siblings(node, direction, adjacent_only, seen = new Set()) {
/** @type {Array<Compiler.AST.Fragment | undefined | null>} */
let fragments = [];
switch (node.type) {
case 'EachBlock':
fragments.push(node.body, node.fallback);
break;
case 'IfBlock':
fragments.push(node.consequent, node.alternate);
break;
case 'AwaitBlock':
fragments.push(node.pending, node.then, node.catch);
break;
case 'KeyBlock':
case 'SlotElement':
fragments.push(node.fragment);
break;
case 'SnippetBlock':
if (seen.has(node)) {
return new Map();
}
seen.add(node);
fragments.push(node.body);
break;
case 'Component':
fragments.push(node.fragment, ...[...node.metadata.snippets].map((s) => s.body));
break;
}
/** @type {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement, NodeExistsValue>} NodeMap */
const result = new Map();
let exhaustive = node.type !== 'SlotElement' && node.type !== 'SnippetBlock';
for (const fragment of fragments) {
if (fragment == null) {
exhaustive = false;
continue;
}
const map = loop_child(fragment.nodes, direction, adjacent_only, seen);
exhaustive &&= has_definite_elements(map);
add_to_map(map, result);
}
if (!exhaustive) {
for (const key of result.keys()) {
result.set(key, NODE_PROBABLY_EXISTS);
}
}
return result;
}
Domain
Subdomains
Source
Frequently Asked Questions
What does get_possible_nested_siblings() do?
get_possible_nested_siblings() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js.
Where is get_possible_nested_siblings() defined?
get_possible_nested_siblings() is defined in packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js at line 1010.
What does get_possible_nested_siblings() call?
get_possible_nested_siblings() calls 3 function(s): add_to_map, has_definite_elements, loop_child.
What calls get_possible_nested_siblings()?
get_possible_nested_siblings() is called by 2 function(s): get_possible_element_siblings, loop_child.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free