(&mut self, setup: Node<'t>)
| 1489 | } |
| 1490 | |
| 1491 | fn extract_pinia_setup_body(&mut self, setup: Node<'t>) { |
| 1492 | let Some(body) = setup.child_by_field_name("body") else { return }; |
| 1493 | if body.kind() != "statement_block" { |
| 1494 | return; |
| 1495 | } |
| 1496 | for i in 0..body.named_child_count() { |
| 1497 | let Some(stmt) = body.named_child(i) else { continue }; |
| 1498 | if stmt.kind() == "function_declaration" { |
| 1499 | self.extract_function(stmt, None); |
| 1500 | } else if is_variable_type(stmt.kind()) { |
| 1501 | for j in 0..stmt.named_child_count() { |
| 1502 | let Some(decl) = stmt.named_child(j) else { continue }; |
| 1503 | if decl.kind() != "variable_declarator" { |
| 1504 | continue; |
| 1505 | } |
| 1506 | if let Some(v) = decl.child_by_field_name("value") { |
| 1507 | if matches!(v.kind(), "arrow_function" | "function_expression") { |
| 1508 | self.extract_function(v, None); |
| 1509 | } |
| 1510 | } |
| 1511 | } |
| 1512 | } |
| 1513 | } |
| 1514 | } |
| 1515 | |
| 1516 | // --- extractTypeAlias + members (#359, #634) ------------------------------------- |
| 1517 |
no test coverage detected