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