Skip to content

Commit 2fec476

Browse files
committed
fix: revert magic number
1 parent 5262ee0 commit 2fec476

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/serializer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
// eslint-disable-next-line
44
const STR_ESCAPE = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/
5-
const MAGIC_NUMBER = 42
65

76
module.exports = class Serializer {
87
constructor (options) {
@@ -93,7 +92,7 @@ module.exports = class Serializer {
9392

9493
asString (str) {
9594
const len = str.length
96-
if (len < MAGIC_NUMBER) {
95+
if (len < 42) {
9796
// magically escape strings for json
9897
// relying on their charCodeAt
9998
// everything below 32 needs JSON.stringify()

0 commit comments

Comments
 (0)