mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
fix: replace regex with replaceAll for secure string replace
This commit is contained in:
@@ -41,7 +41,7 @@ export function patternHasher(input: string, pattern: string | RegExp = VARIABLE
|
||||
let clone = current;
|
||||
for (const hash in hashToOriginal) {
|
||||
const value = hashToOriginal[hash];
|
||||
clone = clone.replace(new RegExp(`(${hash})`, 'g'), value);
|
||||
clone = clone.replaceAll(hash, value);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"target": "ES6",
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"lib": ["es2021"],
|
||||
"skipLibCheck": true,
|
||||
"jsx": "react",
|
||||
"module": "ESNext",
|
||||
|
||||
Reference in New Issue
Block a user