typescriptExtractor.getSignature / javascriptExtractor.getSignature.
(&self, node: Node)
| 1153 | |
| 1154 | /// typescriptExtractor.getSignature / javascriptExtractor.getSignature. |
| 1155 | fn signature_of(&self, node: Node) -> Option<String> { |
| 1156 | let params = node.child_by_field_name("parameters")?; |
| 1157 | let mut sig = self.text(params).to_string(); |
| 1158 | if self.variant.is_ts() { |
| 1159 | if let Some(ret) = node.child_by_field_name("return_type") { |
| 1160 | let ret_text = self.text(ret); |
| 1161 | let stripped = ret_text.strip_prefix(':').unwrap_or(ret_text).trim_start(); |
| 1162 | sig.push_str(": "); |
| 1163 | sig.push_str(stripped); |
| 1164 | } |
| 1165 | } |
| 1166 | Some(sig) |
| 1167 | } |
| 1168 | |
| 1169 | /// typescriptExtractor.getVisibility (TS only — JS has no hook). |
| 1170 | fn visibility_of(&self, node: Node) -> Option<u8> { |
no test coverage detected