Skip to content

Commit

Permalink
~> noQuotes
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 1, 2025
1 parent ce7e2e0 commit f842a0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ const Serializer = /*@__PURE__*/ (function () {
}

return String.prototype.localeCompare.call(
this.serialize(a, false),
this.serialize(b, false),
this.serialize(a, true),
this.serialize(b, true),
);
}

serialize(value: any, addQuotes = true): string {
serialize(value: any, noQuotes?: boolean): string {
if (value === null) {
return "null";
}

switch (typeof value) {
case "string": {
return addQuotes ? `'${value}'` : value;
return noQuotes ? value : `'${value}'`;
}
case "bigint": {
return `${value}n`;
Expand Down

0 comments on commit f842a0c

Please sign in to comment.