typescriptExtractor.getSignature / javascriptExtractor.getSignature.
(&self, node: Node)
| 759 | |
| 760 | /// typescriptExtractor.getSignature / javascriptExtractor.getSignature. |
| 761 | fn signature_of(&self, node: Node) -> Option<String> { |
| 762 | let params = node.child_by_field_name("parameters")?; |
| 763 | let mut sig = self.text(params).to_string(); |
| 764 | if self.variant.is_ts() { |
| 765 | if let Some(ret) = node.child_by_field_name("return_type") { |
| 766 | let ret_text = self.text(ret); |
| 767 | let stripped = ret_text.strip_prefix(':').unwrap_or(ret_text).trim_start(); |
| 768 | sig.push_str(": "); |
| 769 | sig.push_str(stripped); |
| 770 | } |
| 771 | } |
| 772 | Some(sig) |
| 773 | } |
| 774 | |
| 775 | /// typescriptExtractor.getVisibility (TS only — JS has no hook). |
| 776 | fn visibility_of(&self, node: Node) -> Option<u8> { |
no test coverage detected