mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-19 08:21:21 +03:00
Refactor finding comparison logic in render_report.mjs to simplify equality checks
This commit is contained in:
@@ -222,7 +222,7 @@ const { active: activeFindings, suppressed: suppressedFindings } = filterFinding
|
||||
// Replace findings in audit/deep with filtered active findings
|
||||
if (audit.findings) {
|
||||
audit.findings = activeFindings.filter((f) =>
|
||||
(audit.findings || []).some((orig) => orig === f || JSON.stringify(orig) === JSON.stringify(f))
|
||||
(audit.findings || []).some((orig) => orig === f)
|
||||
);
|
||||
// Recalculate summary counts after filtering
|
||||
audit.summary = {
|
||||
@@ -233,7 +233,7 @@ if (audit.findings) {
|
||||
}
|
||||
if (deep.findings) {
|
||||
deep.findings = activeFindings.filter((f) =>
|
||||
(deep.findings || []).some((orig) => orig === f || JSON.stringify(orig) === JSON.stringify(f))
|
||||
(deep.findings || []).some((orig) => orig === f)
|
||||
);
|
||||
// Recalculate summary counts after filtering
|
||||
deep.summary = {
|
||||
|
||||
Reference in New Issue
Block a user