@gscdump/engine-gsc-api 7.9.0 → 7.10.0
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/dist/post-process.mjs +10 -1
- package/package.json +3 -3
package/dist/post-process.mjs
CHANGED
|
@@ -141,10 +141,19 @@ function applyBuilderStatePostProcessing(rows, state) {
|
|
|
141
141
|
filtered.push(row);
|
|
142
142
|
if (checkFiniteOrderValues && !Number.isFinite(metricValue(row, column))) hasNonFiniteOrderValue = true;
|
|
143
143
|
}
|
|
144
|
+
const tieDimensions = [...new Set(state.dimensions)].filter((dimension) => dimension !== column);
|
|
145
|
+
const compareTies = (a, b) => {
|
|
146
|
+
for (const dimension of tieDimensions) {
|
|
147
|
+
const left = String(a[dimension] ?? "");
|
|
148
|
+
const right = String(b[dimension] ?? "");
|
|
149
|
+
if (left !== right) return left < right ? -1 : 1;
|
|
150
|
+
}
|
|
151
|
+
return 0;
|
|
152
|
+
};
|
|
144
153
|
const compareRows = (a, b) => {
|
|
145
154
|
const left = column === "date" ? String(a.date ?? "") : metricValue(a, column);
|
|
146
155
|
const right = column === "date" ? String(b.date ?? "") : metricValue(b, column);
|
|
147
|
-
if (left === right) return
|
|
156
|
+
if (left === right) return compareTies(a, b);
|
|
148
157
|
if (dir === "asc") return left < right ? -1 : 1;
|
|
149
158
|
return left > right ? -1 : 1;
|
|
150
159
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gscdump/engine-gsc-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.10.0",
|
|
5
5
|
"description": "GSC live-API engine adapter — wraps the Search Analytics REST API as an AnalysisQuerySource for typed analyzer dispatch.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"node": ">=22.13.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@gscdump/engine": "^7.
|
|
40
|
-
"gscdump": "^7.
|
|
39
|
+
"@gscdump/engine": "^7.10.0",
|
|
40
|
+
"gscdump": "^7.10.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"vitest": "^5.0.1"
|