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

Method extract_pinia_setup_body

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

Source from the content-addressed store, hash-verified

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

Callers 1

extract_variableMethod · 0.80

Calls 2

is_variable_typeFunction · 0.85
extract_functionMethod · 0.45

Tested by

no test coverage detected