This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* searches deep into an object recursively... | |
* @param {Object} obj object to be searched | |
* @param {any} searchValue the value/key to search for | |
* @param {Object} [options] | |
* @param {boolean} options.[searchKeys] whether to search object keys as well as values. Defaults to `true` if `serchValue` is a string, `false` otherwise. | |
* @param {number} options.[maxDepth=20] maximum recursion depth (to avoid "Maximum call stack size exceeded") | |
* @returns {string[]} Paths on the object to the matching results | |
*/ | |
const findPaths = ( |