From 198fadc5c5586256e16488d9fe192fb794575cc0 Mon Sep 17 00:00:00 2001 From: ready-research <72916209+ready-research@users.noreply.github.com> Date: Thu, 11 Feb 2021 13:26:44 +0530 Subject: [PATCH 1/2] Update index.js --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index ff07626..d2ec4af 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ function assign(target, source) { for (let i in source) { + if (target[i] == '__proto__' || target[i] == 'prototype' || target[i] == 'constructor') return {}; if (Array.isArray(target[i])) { concat(target[i], source[i]); } else if (typeof(target[i]) == "object") { From 7cbfb9a7936e6f4633f1f499e04a33d8356bfbac Mon Sep 17 00:00:00 2001 From: ready-research <72916209+ready-research@users.noreply.github.com> Date: Thu, 11 Feb 2021 13:59:39 +0530 Subject: [PATCH 2/2] Update index.js --- src/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index d2ec4af..20a7eb9 100644 --- a/src/index.js +++ b/src/index.js @@ -2,10 +2,9 @@ function assign(target, source) { for (let i in source) { - if (target[i] == '__proto__' || target[i] == 'prototype' || target[i] == 'constructor') return {}; if (Array.isArray(target[i])) { concat(target[i], source[i]); - } else if (typeof(target[i]) == "object") { + } else if (typeof(target[i]) == "object" && (target[i] == '__proto__' || target[i] == 'prototype' || target[i] == 'constructor')) { assign(target[i], source[i]); } else { target[i] = source[i];