add badge for sidebar
This commit is contained in:
14
src/core/utils/getValueByPath.js
Normal file
14
src/core/utils/getValueByPath.js
Normal file
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user