(&mut self, setup: Node<'t>)
| 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 |
no test coverage detected