fix: keep project entity selection and ignore placeholder hits

This commit is contained in:
muena
2026-09-26 15:09:53 +02:00
parent 5877b7cf5f
commit 6cb5b0efc5
5 changed files with 90 additions and 10 deletions

View File

@@ -88,6 +88,12 @@ export function withoutWhitelistedHits<T extends GroupableHit>(hits: T[], whitel
return hits.filter((hit) => !excluded.has(whitelistKey(hit)));
}
/** A later run must not turn an existing Velum placeholder plus adjacent text into a new entity. */
export function withoutPlaceholderHits<T extends { original: string; type: string }>(hits: T[]): T[] {
const placeholder = /(?<![\p{L}\p{N}])[A-Z][A-Z0-9]*_\d{2,}(?![\p{L}\p{N}])/u;
return hits.filter((hit) => hit.type === "PASSWORT" || !placeholder.test(hit.original));
}
export function withoutWhitelistedRules<T extends { type: string; value: string }>(
rules: T[], whitelist: ProjectWhitelistEntry[],
): T[] {