Function encodeEscaped

  • This function:

    1. Keeps regular spaces, only ' ', as they are.
    2. Converts \n \r \t to escaped versions, \\n \\r and \\t.
    3. Converts other control characters to their Unicode escape sequences.\
    4. Converts ' " to escaped versions, \\\\' \\\\ and \\"

    Unless you're using this in a JSON.stringify replacer, you probably want to use encodeEscapedWrapped instead.

    Parameters

    • str: string

    Returns string

Generated using TypeDoc