svelte-common 6.10.20 → 6.10.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sorting.mjs +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.10.20",
3
+ "version": "6.10.21",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
package/src/sorting.mjs CHANGED
@@ -98,9 +98,8 @@ export function sorter(sortBy, getters) {
98
98
  switch (typeof av) {
99
99
  case "undefined":
100
100
  return bv === undefined ? 0 : -rev;
101
-
102
101
  case "string":
103
- switch (typeof bv) {
102
+ switch (typeof bv) {
104
103
  case "number":
105
104
  bv = String(bv);
106
105
  case "string":
@@ -116,9 +115,16 @@ export function sorter(sortBy, getters) {
116
115
  if (av[Symbol.toPrimitive]) {
117
116
  av = av[Symbol.toPrimitive]("number");
118
117
  }
118
+ else {
119
+ av = av.toString();
120
+ }
121
+
119
122
  if (bv[Symbol.toPrimitive]) {
120
123
  bv = bv[Symbol.toPrimitive]("number");
121
124
  }
125
+ else {
126
+ bv = bv.toString();
127
+ }
122
128
 
123
129
  return av > bv ? rev : av == bv ? 0 : -rev;
124
130
  };