Merge pull request #67 from RooVetGit/alert-autofix-2

Fix code scanning alert no. 2: Prototype-polluting function
This commit is contained in:
Matt Rubens
2024-12-11 13:04:01 -05:00
committed by GitHub

View File

@@ -462,11 +462,14 @@ export const highlight = (
let i: number let i: number
for (i = 0; i < pathValue.length - 1; i++) { for (i = 0; i < pathValue.length - 1; i++) {
if (pathValue[i] === "__proto__" || pathValue[i] === "constructor") return
obj = obj[pathValue[i]] as Record<string, any> obj = obj[pathValue[i]] as Record<string, any>
} }
if (pathValue[i] !== "__proto__" && pathValue[i] !== "constructor") {
obj[pathValue[i]] = value obj[pathValue[i]] = value
} }
}
// Function to merge overlapping regions // Function to merge overlapping regions
const mergeRegions = (regions: [number, number][]): [number, number][] => { const mergeRegions = (regions: [number, number][]): [number, number][] => {