MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extract_pinia_setup_body

Method extract_pinia_setup_body

codegraph-kernel/src/tsjs/extractors.rs:1353–1376  ·  view source on GitHub ↗
(&mut self, setup: Node<'t>)

Source from the content-addressed store, hash-verified

1351 }
1352
1353 fn extract_pinia_setup_body(&mut self, setup: Node<'t>) {
1354 let Some(body) = setup.child_by_field_name("body") else { return };
1355 if body.kind() != "statement_block" {
1356 return;
1357 }
1358 for i in 0..body.named_child_count() {
1359 let Some(stmt) = body.named_child(i) else { continue };
1360 if stmt.kind() == "function_declaration" {
1361 self.extract_function(stmt, None);
1362 } else if is_variable_type(stmt.kind()) {
1363 for j in 0..stmt.named_child_count() {
1364 let Some(decl) = stmt.named_child(j) else { continue };
1365 if decl.kind() != "variable_declarator" {
1366 continue;
1367 }
1368 if let Some(v) = decl.child_by_field_name("value") {
1369 if matches!(v.kind(), "arrow_function" | "function_expression") {
1370 self.extract_function(v, None);
1371 }
1372 }
1373 }
1374 }
1375 }
1376 }
1377
1378 // --- extractTypeAlias + members (#359, #634) -------------------------------------
1379

Callers 1

extract_variableMethod · 0.80

Calls 2

is_variable_typeFunction · 0.85
extract_functionMethod · 0.45

Tested by

no test coverage detected