As of 1.2.0, undefsafe supports a * in the path if you want to search all of the properties (or array elements) for a particular element.
The function will only return a single result, either the 3rd argument validation value, or the first positive match. For example, the following github data:
const githubData = { commits: [{ modified: [ "one", "two" ] }, /* ... */ ] };// first modified file found in the first commitconsole.log(undefsafe(githubData, 'commits.*.modified.0'));// returns `two` or undefined if not foundconsole.log(undefsafe(githubData, 'commits.*.modified.*', 'two'));