@carto/api-client 0.5.9 → 0.5.10
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.
- package/CHANGELOG.md +4 -0
- package/build/api-client.cjs +9 -6
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +1 -1
- package/build/api-client.d.ts +1 -1
- package/build/api-client.js +9 -6
- package/build/api-client.js.map +1 -1
- package/build/worker-compat.js +9 -6
- package/build/worker-compat.js.map +1 -1
- package/build/worker.js +9 -6
- package/build/worker.js.map +1 -1
- package/package.json +1 -1
- package/src/operations/groupBy.ts +14 -6
- package/src/widget-sources/types.ts +5 -1
package/build/worker.js
CHANGED
|
@@ -5725,17 +5725,20 @@ function groupValuesByColumn({
|
|
|
5725
5725
|
function getSorter(orderBy) {
|
|
5726
5726
|
switch (orderBy) {
|
|
5727
5727
|
case "frequency_asc":
|
|
5728
|
-
return (a, b) => a.value - b.value ||
|
|
5728
|
+
return (a, b) => a.value - b.value || nameCompare(a.name, b.name);
|
|
5729
5729
|
case "frequency_desc":
|
|
5730
|
-
return (a, b) => b.value - a.value ||
|
|
5730
|
+
return (a, b) => b.value - a.value || nameCompare(a.name, b.name);
|
|
5731
5731
|
case "alphabetical_asc":
|
|
5732
|
-
return (a, b) =>
|
|
5732
|
+
return (a, b) => nameCompare(a.name, b.name) || b.value - a.value;
|
|
5733
5733
|
case "alphabetical_desc":
|
|
5734
|
-
return (a, b) =>
|
|
5734
|
+
return (a, b) => nameCompare(b.name, a.name) || b.value - a.value;
|
|
5735
5735
|
}
|
|
5736
5736
|
}
|
|
5737
|
-
function
|
|
5738
|
-
|
|
5737
|
+
function nameCompare(a, b) {
|
|
5738
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
5739
|
+
return a - b;
|
|
5740
|
+
}
|
|
5741
|
+
return String(a ?? "null").localeCompare(String(b ?? "null"));
|
|
5739
5742
|
}
|
|
5740
5743
|
|
|
5741
5744
|
// src/utils/dateUtils.ts
|