(s: string)
| 20 | const NULL_BYTE_RE = new RegExp(NULL_BYTE, 'g'); |
| 21 | |
| 22 | function stripNullBytesString(s: string): string { |
| 23 | return s.includes(NULL_BYTE) ? s.replace(NULL_BYTE_RE, '') : s; |
| 24 | } |
| 25 | |
| 26 | function stripNullBytesFromJson(json: string): string { |
| 27 | // JSON.stringify encodes a null byte as a six-character backslash-u escape. |