typescriptExtractor.getSignature / javascriptExtractor.getSignature.
(&self, node: Node)
| 1039 | |
| 1040 | /// typescriptExtractor.getSignature / javascriptExtractor.getSignature. |
| 1041 | fn signature_of(&self, node: Node) -> Option<String> { |
| 1042 | let params = node.child_by_field_name("parameters")?; |
| 1043 | let mut sig = self.text(params).to_string(); |
| 1044 | if self.variant.is_ts() { |
| 1045 | if let Some(ret) = node.child_by_field_name("return_type") { |
| 1046 | let ret_text = self.text(ret); |
| 1047 | let stripped = ret_text.strip_prefix(':').unwrap_or(ret_text).trim_start(); |
| 1048 | sig.push_str(": "); |
| 1049 | sig.push_str(stripped); |
| 1050 | } |
| 1051 | } |
| 1052 | Some(sig) |
| 1053 | } |
| 1054 | |
| 1055 | /// typescriptExtractor.getVisibility (TS only — JS has no hook). |
| 1056 | fn visibility_of(&self, node: Node) -> Option<u8> { |
no test coverage detected