FIX: fixed condition of getObjValueFromPath

This commit is contained in:
Gabriel Rosa
2022-11-09 20:06:23 -03:00
parent abc6258492
commit 4a7e660a49
3 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ export function getObjValueFromPath<T>(data: { object: T; path: string }): T {
let value = JSON.parse(JSON.stringify(object));
for (const key of keys) {
if (value) value = value[key];
if (value != undefined) value = value[key];
}
return value;
}