Fixes CodeQL issues (#4090)

This commit is contained in:
Henning Dieterichs 2023-07-19 17:05:52 +02:00 committed by GitHub
parent be57cbf4ef
commit 97c7fdb35c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View file

@ -44626,7 +44626,7 @@ ${lanes.join("\n")}
for (const { ending, value } of candidates) {
if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
const matchedStar = value.substring(prefix.length, value.length - suffix.length);
return key.replace("*", matchedStar);
return key.replace("*", matchedStar); // CodeQL [SM02383] This is a false positive, the code is from the TypeScript compiler
}
}
} else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {