`.replace(/\s+/g, ' ')` for the tuple-contract signature.
(s: &str)
| 2254 | |
| 2255 | /// `.replace(/\s+/g, ' ')` for the tuple-contract signature. |
| 2256 | fn collapse_ws(s: &str) -> String { |
| 2257 | let mut out = String::with_capacity(s.len()); |
| 2258 | let mut in_ws = false; |
| 2259 | for c in s.chars() { |
| 2260 | if c.is_whitespace() { |
| 2261 | if !in_ws { |
| 2262 | out.push(' '); |
| 2263 | in_ws = true; |
| 2264 | } |
| 2265 | } else { |
| 2266 | out.push(c); |
| 2267 | in_ws = false; |
| 2268 | } |
| 2269 | } |
| 2270 | out |
| 2271 | } |
| 2272 | |
| 2273 | /// TS/JS wrappers that keep a member call's receiver the same object |
| 2274 | /// (mirrors TS_JS_TRANSPARENT_RECEIVER_TYPES in tree-sitter.ts). |
no test coverage detected