pub fn is_javascript_whitespace(character: char) -> boolExpand description
What:
Whether a character is whitespace or a line terminator to ECMAScript trim.
char is one Unicode scalar value.
Why:
ECMA-262 TrimString removes WhiteSpace (tab,
vertical tab,
form feed,
space,
no-break space,
U+FEFF and every Zs character) and LineTerminator (LF,
CR,
U+2028,
U+2029);
nothing else.
In TS you’d write (pseudocode):
/^\s$/u.test(character) // JavaScript's \s is exactly this set