1.0.2 • Published 10 years ago

recursive-find v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

recursive-find

Recursively find values of an object that match a test function

npm install recursive-find

build status

example

var recursiveFind = require('recursive-find')

var data = {
  title: 'El Duderino',
  url: 'http://dooder.com',
  links: [
    {url: 'http://dooder.com/about'},
    {url: 'http://dooder.com/contact'},
    {url: 'http://google.com'}
  ],
}

var urls = recursiveFind(data, function(value) {
  return typeof value === 'string' && value.indexOf('http://dooder.com') >= 0
})

console.log(urls)
// [ 'http://dooder.com',
//   'http://dooder.com/about',
//   'http://dooder.com/contact' ]

license

MIT

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago