fix: allow rerunning imported projects
This commit is contained in:
@@ -89,9 +89,14 @@ export function withoutWhitelistedHits<T extends GroupableHit>(hits: T[], whitel
|
||||
}
|
||||
|
||||
/** 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[] {
|
||||
export function withoutPlaceholderHits<T extends { original: string; type: string }>(
|
||||
hits: T[], knownPlaceholders: Iterable<string> = [],
|
||||
): 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));
|
||||
const known = [...knownPlaceholders].filter(Boolean);
|
||||
return hits.filter((hit) => hit.type === "PASSWORT" || (
|
||||
!placeholder.test(hit.original) && !known.some((key) => hit.original.includes(key))
|
||||
));
|
||||
}
|
||||
|
||||
export function withoutWhitelistedRules<T extends { type: string; value: string }>(
|
||||
|
||||
Reference in New Issue
Block a user