fix: use includes matching for exclusions location and suggestion

This commit is contained in:
2026-05-12 02:10:47 +00:00
parent 3c3019d1ab
commit f1c21beed5
+2 -2
View File
@@ -124,8 +124,8 @@ export function applyExclusions(findings, exclusions) {
const before = findings.length;
const filtered = findings.filter(f => !exclusions.some(ex =>
(!ex.role || ex.role === f.role) &&
(!ex.location || ex.location === f.location) &&
(!ex.suggestion || String(f.suggestion).startsWith(String(ex.suggestion).slice(0, 50)))
(!ex.location || String(f.location).includes(ex.location)) &&
(!ex.suggestion || String(f.suggestion).includes(String(ex.suggestion).slice(0, 20)))
));
console.log(` 排除過濾: ${before} -> ${filtered.length} 筆(排除 ${before - filtered.length} 筆)`);
return filtered;