n8n/patches/lodash@4.18.1.patch
n8n-assistant[bot] f6cb6cf3ab
chore: Bundle/2.x (backport to release-candidate/2.31.x) (#34688)
Co-authored-by: n8n-assistant[bot] <100856346+n8n-assistant[bot]@users.noreply.github.com>
Co-authored-by: Charlie Kolb <charlie@n8n.io>
2026-07-22 10:59:50 +02:00

27 lines
1.2 KiB
Diff

diff --git a/_baseSet.js b/_baseSet.js
index 99f4fbf9c347a74594f975df62ee353d06c85c55..316f9e8b537e294230c5123789c224c41a7034e8 100644
--- a/_baseSet.js
+++ b/_baseSet.js
@@ -37,7 +37,7 @@ function baseSet(object, path, value, customizer) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
- newValue = isObject(objValue)
+ newValue = isObject(objValue) && Object.prototype.hasOwnProperty.call(nested, key)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
diff --git a/lodash.js b/lodash.js
index 8634cab16747f81f9336d1a231dc501af460179d..b1939f267103be4e76b4828b37472797f4859632 100644
--- a/lodash.js
+++ b/lodash.js
@@ -4045,7 +4045,7 @@
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
- newValue = isObject(objValue)
+ newValue = isObject(objValue) && Object.prototype.hasOwnProperty.call(nested, key)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}