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

Method extract_pinia_setup_body

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

Source from the content-addressed store, hash-verified

773 }
774
775 fn extract_pinia_setup_body(&mut self, setup: Node<'t>) {
776 let Some(body) = setup.child_by_field_name("body") else { return };
777 if body.kind() != "statement_block" {
778 return;
779 }
780 for i in 0..body.named_child_count() {
781 let Some(stmt) = body.named_child(i) else { continue };
782 if stmt.kind() == "function_declaration" {
783 self.extract_function(stmt, None);
784 } else if is_variable_type(stmt.kind()) {
785 for j in 0..stmt.named_child_count() {
786 let Some(decl) = stmt.named_child(j) else { continue };
787 if decl.kind() != "variable_declarator" {
788 continue;
789 }
790 if let Some(v) = decl.child_by_field_name("value") {
791 if matches!(v.kind(), "arrow_function" | "function_expression") {
792 self.extract_function(v, None);
793 }
794 }
795 }
796 }
797 }
798 }
799
800 // --- extractTypeAlias + members (#359, #634) -------------------------------------
801

Callers 1

extract_variableMethod · 0.80

Calls 2

is_variable_typeFunction · 0.85
extract_functionMethod · 0.45

Tested by

no test coverage detected