JS `\s` for the chained-call inner-callee strip (`.replace(/\s+/g, '')`).
(c: char)
| 99 | |
| 100 | /// JS `\s` for the chained-call inner-callee strip (`.replace(/\s+/g, '')`). |
| 101 | fn is_js_space(c: char) -> bool { |
| 102 | matches!( |
| 103 | c, |
| 104 | '\t' | '\n' | '\x0B' | '\x0C' | '\r' | ' ' | '\u{00A0}' | '\u{1680}' |
| 105 | | '\u{2000}'..='\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' |
| 106 | | '\u{3000}' | '\u{FEFF}' |
| 107 | ) |
| 108 | } |
| 109 | fn strip_js_ws(s: &str) -> String { |
| 110 | s.chars().filter(|c| !is_js_space(*c)).collect() |
| 111 | } |