fix(complex-matcher): avoid array allocation in isRawString (#9813)

This commit is contained in:
Julien Fontanet
2026-05-07 17:02:25 +02:00
committed by GitHub
parent fd9e271139
commit c5b7e7d2cb

View File

@@ -17,7 +17,12 @@ const RAW_STRING_SYMBOLS = {
const isRawStringChar = c =>
(c >= '0' && c <= '9') || c in RAW_STRING_SYMBOLS || !(c === c.toUpperCase() && c === c.toLowerCase())
const isRawString = string => [...string].every(isRawStringChar)
const isRawString = string => {
for (const c of string) {
if (!isRawStringChar(c)) return false
}
return true
}
// -------------------------------------------------------------------