/** * Find property path in the object with a value * @param {object} obj * @param {any} value * @return {string} */ function findPropertyPathWithValue(obj, value) { for (const key in obj) { if (JSON.stringify(value) === JSON.stringify(obj[key])) { return key; } else if (typeof obj[key] === 'object') { const pathname = findPropertyPathWithValue(obj[key], value); if (pathname) { return key + '.' + pathname; } } } }