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