YuriGor / deepdash

eachDeep, filterDeep, findDeep, someDeep, omitDeep, pickDeep, keysDeep etc.. Tree traversal library written in Underscore/Lodash fashion
https://deepdash.io/
MIT License
274 stars 12 forks source link

Deeply find a node and return the path to the node (as array of nodes) #73

Closed vjpr closed 3 years ago

vjpr commented 3 years ago
{
  name: 'foo',
  children: [
    {name: 'bar'},
  ]
}
const [item, pathArray] = findWithPath(node => name === 'bar')
YuriGor commented 3 years ago

Hi @vjpr, we have findDeep It returns the object with value and context/path inside.