@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/CHANGELOG.md
CHANGED
package/build/api-client.cjs
CHANGED
|
@@ -7071,17 +7071,20 @@ function groupValuesByColumn({
|
|
|
7071
7071
|
function getSorter(orderBy) {
|
|
7072
7072
|
switch (orderBy) {
|
|
7073
7073
|
case "frequency_asc":
|
|
7074
|
-
return (a, b) => a.value - b.value ||
|
|
7074
|
+
return (a, b) => a.value - b.value || nameCompare(a.name, b.name);
|
|
7075
7075
|
case "frequency_desc":
|
|
7076
|
-
return (a, b) => b.value - a.value ||
|
|
7076
|
+
return (a, b) => b.value - a.value || nameCompare(a.name, b.name);
|
|
7077
7077
|
case "alphabetical_asc":
|
|
7078
|
-
return (a, b) =>
|
|
7078
|
+
return (a, b) => nameCompare(a.name, b.name) || b.value - a.value;
|
|
7079
7079
|
case "alphabetical_desc":
|
|
7080
|
-
return (a, b) =>
|
|
7080
|
+
return (a, b) => nameCompare(b.name, a.name) || b.value - a.value;
|
|
7081
7081
|
}
|
|
7082
7082
|
}
|
|
7083
|
-
function
|
|
7084
|
-
|
|
7083
|
+
function nameCompare(a, b) {
|
|
7084
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
7085
|
+
return a - b;
|
|
7086
|
+
}
|
|
7087
|
+
return String(a ?? "null").localeCompare(String(b ?? "null"));
|
|
7085
7088
|
}
|
|
7086
7089
|
|
|
7087
7090
|
// src/operations/groupByDate.ts
|