fix: keep project entity selection and ignore placeholder hits
This commit is contained in:
@@ -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[] {
|
||||
|
||||
Reference in New Issue
Block a user