Skip to content

Commit 327f556

Browse files
Potential fix for code scanning alert no. 4: Prototype-polluting function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 7aa85ee commit 327f556

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/build/helpers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ export function merge<T>(
134134
throw new Error("Either `target` or `src` is null");
135135
}
136136
for (const k in src) {
137+
if (k === "__proto__" || k === "constructor" || k === "prototype") {
138+
continue;
139+
}
137140
if (Object.getOwnPropertyDescriptor(src, k)) {
138141
if (Object.getOwnPropertyDescriptor(target, k)) {
139142
const targetProp = target[k];

0 commit comments

Comments
 (0)