pub fn quote(text: &str) -> StringExpand description
What:
Quote text as a JSON string literal.
Why:
serde_json escapes ",
\ and control characters as JSON.stringify does;
serializing a &str cannot fail.
In TS you’d write (pseudocode):
JSON.stringify(text)