typescriptExtractor.getSignature / javascriptExtractor.getSignature.
(&self, node: Node)
| 1021 | |
| 1022 | /// typescriptExtractor.getSignature / javascriptExtractor.getSignature. |
| 1023 | fn signature_of(&self, node: Node) -> Option<String> { |
| 1024 | let params = node.child_by_field_name("parameters")?; |
| 1025 | let mut sig = self.text(params).to_string(); |
| 1026 | if self.variant.is_ts() { |
| 1027 | if let Some(ret) = node.child_by_field_name("return_type") { |
| 1028 | let ret_text = self.text(ret); |
| 1029 | let stripped = ret_text.strip_prefix(':').unwrap_or(ret_text).trim_start(); |
| 1030 | sig.push_str(": "); |
| 1031 | sig.push_str(stripped); |
| 1032 | } |
| 1033 | } |
| 1034 | Some(sig) |
| 1035 | } |
| 1036 | |
| 1037 | /// typescriptExtractor.getVisibility (TS only — JS has no hook). |
| 1038 | fn visibility_of(&self, node: Node) -> Option<u8> { |
no test coverage detected