From 7867382c9f7afedc43bae51240b1e98ea02e20ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Brzezina?= Date: Mon, 11 Mar 2024 19:10:37 +0100 Subject: [PATCH] fix(core): properties with similar names map to undefined --- packages/core/src/lib/utils/get-path.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/lib/utils/get-path.ts b/packages/core/src/lib/utils/get-path.ts index 319a8f42e..4e5ac3f52 100644 --- a/packages/core/src/lib/utils/get-path.ts +++ b/packages/core/src/lib/utils/get-path.ts @@ -36,7 +36,7 @@ export function getFlatteningPaths( ); let trueFirstPartOfSource = first; let stopIndex = 0; - let found = hasProperty(src, trueFirstPartOfSource); + let found = hasProperty(src, trueFirstPartOfSource) && typeof src[trueFirstPartOfSource] === 'object'; if (!found) { for (let i = 0, len = paths.length; i < len; i++) { @@ -45,7 +45,7 @@ export function getFlatteningPaths( trueFirstPartOfSource, paths[i], ]); - if (hasProperty(src, trueFirstPartOfSource)) { + if (hasProperty(src, trueFirstPartOfSource) && typeof src[trueFirstPartOfSource] === 'object') { stopIndex = i + 1; found = true; break;