Added debug section to inspect extension's local storage

This commit is contained in:
koloml committed 2024-08-12 19:37:35 +04:00
1 parent f9cb73bafc
commit 68d1d726af
7 files changed
+189

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
/**
* Traverse and find the object using the key path.
* @param {Object} targetObject Target object to traverse into.
* @param {string[]} path Path of keys to traverse deep into the object.
* @return {Object|null} Resulting object or null if nothing found (or target entry is not an object.
*/
export function findDeepObject(targetObject, path) {
let result = targetObject;
for (let key of path) {
if (!result || typeof result !== 'object') {
return null;
}
result = result[key];
}
if (!result || typeof result !== "object") {
return null;
}
return result;
}