Skip to content

Commit

Permalink
Fix code scanning alert no. 234: Prototype-polluting function
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent e319cdb commit 409ff93
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function isObject(item) {
export default function merge(target, source) {
if (isObject(target) && isObject(source)) {
Object.keys(source).forEach((key) => {
if (key === "__proto__" || key === "constructor") return;
if (isObject(source[key])) {
if (!target[key] || !isObject(target[key])) {
target[key] = source[key]
Expand Down

0 comments on commit 409ff93

Please sign in to comment.