Skip to content

Commit a1ef06b

Browse files
committed
refactor: use toString for readability
1 parent ea4401f commit a1ef06b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/stringify.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ function getAsPrimitive(value) {
99
// Length check is handled inside encodeString function
1010
return encodeString(value);
1111
} else if (type === "bigint") {
12-
return value + "";
12+
return value.toString();
1313
} else if (type === "boolean") {
1414
return value ? "true" : "false";
1515
} else if (type === "number" && Number.isFinite(value)) {
16-
if (Math.abs(value) < 1e21) return value + "";
17-
return encodeString(value + "");
16+
if (Math.abs(value) < 1e21) return value.toString();
17+
return encodeString(value.toString());
1818
}
1919

2020
return "";

0 commit comments

Comments
 (0)