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 ea4401f commit a1ef06bCopy full SHA for a1ef06b
1 file changed
lib/stringify.js
@@ -9,12 +9,12 @@ function getAsPrimitive(value) {
9
// Length check is handled inside encodeString function
10
return encodeString(value);
11
} else if (type === "bigint") {
12
- return value + "";
+ return value.toString();
13
} else if (type === "boolean") {
14
return value ? "true" : "false";
15
} else if (type === "number" && Number.isFinite(value)) {
16
- if (Math.abs(value) < 1e21) return value + "";
17
- return encodeString(value + "");
+ if (Math.abs(value) < 1e21) return value.toString();
+ return encodeString(value.toString());
18
}
19
20
return "";
0 commit comments