We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1197be3 commit 64e163dCopy full SHA for 64e163d
lib/serializer.js
@@ -141,11 +141,8 @@ module.exports = class Serializer {
141
// eslint-disable-next-line
142
for (var i = 0; i < len; i++) {
143
point = str.charCodeAt(i)
144
- if (point < 32) {
145
- return JSON.stringify(str)
146
- }
147
- if (point >= 0xD800 && point <= 0xDFFF) {
148
- // The current character is a surrogate.
+ if (point < 32 || (point >= 0xD800 && point <= 0xDFFF)) {
+ // The current character is non-printable characters or a surrogate.
149
return JSON.stringify(str)
150
}
151
if (
0 commit comments