test(perf): reduce security audit and guardrail overhead

This commit is contained in:
Peter Steinberger
2026-03-02 11:41:33 +00:00
parent 316875582a
commit 735216f7e4
2 changed files with 55 additions and 75 deletions

View File

@@ -225,7 +225,11 @@ describe("temp path guard", () => {
if (hasDynamicTmpdirJoin(file.source)) {
offenders.push(relativePath);
}
if (WEAK_RANDOM_SAME_LINE_PATTERN.test(file.source)) {
if (
file.source.includes("Date.now") &&
file.source.includes("Math.random") &&
WEAK_RANDOM_SAME_LINE_PATTERN.test(file.source)
) {
weakRandomMatches.push(relativePath);
}
}