(json: string)
| 16 | const JS_LINE_TERMINATORS = /\u2028|\u2029/g |
| 17 | |
| 18 | function escapeJsLineTerminators(json: string): string { |
| 19 | return json.replace(JS_LINE_TERMINATORS, c => |
| 20 | c === '\u2028' ? '\\u2028' : '\\u2029', |
| 21 | ) |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * JSON.stringify for one-message-per-line transports. Escapes U+2028 |
no outgoing calls
no test coverage detected