Files
frontend/src/core/utils/getValueByPath.js
AmirHossein Mahmoodi 12d6d08bef Feature/amiriis missions
2025-06-25 07:41:03 +00:00

15 lines
279 B
JavaScript

export const getValueByPath = (obj, path) => {
const keys = path.split(".");
let value = obj;
for (const key of keys) {
if (value === undefined) {
return undefined;
}
value = value[key];
}
return value;
};