@diegovelasquezweb/a11y-engine 0.11.6 → 0.11.7
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/package.json
CHANGED
|
@@ -608,13 +608,18 @@ function deduplicateFindings(findings) {
|
|
|
608
608
|
if (group.length === 1) {
|
|
609
609
|
result.push(group[0]);
|
|
610
610
|
} else {
|
|
611
|
-
|
|
611
|
+
// Confirmed findings (needs_verification=false) always take priority over incomplete ones.
|
|
612
|
+
// Among confirmed, pick the one with most instances; same for incomplete-only groups.
|
|
613
|
+
const confirmed = group.filter((f) => !f.needs_verification);
|
|
614
|
+
const pool = confirmed.length > 0 ? confirmed : group;
|
|
615
|
+
const representative = pool.reduce((best, f) =>
|
|
612
616
|
(f.total_instances || 1) >= (best.total_instances || 1) ? f : best,
|
|
613
617
|
);
|
|
614
618
|
const affectedUrls = [...new Set(group.map((f) => f.url))];
|
|
615
619
|
const totalInstances = group.reduce((sum, f) => sum + (f.total_instances || 1), 0);
|
|
616
620
|
result.push({
|
|
617
621
|
...representative,
|
|
622
|
+
needs_verification: confirmed.length === 0,
|
|
618
623
|
total_instances: totalInstances,
|
|
619
624
|
pages_affected: affectedUrls.length,
|
|
620
625
|
affected_urls: affectedUrls,
|