Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deep-find

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-find

find value for deep nesting keys

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

deep-find NPM version Build Status Dependency Status

find value for deep nested keys

Install

$ npm install --save deep-find

Usage

JavaScript

var deepFind = require('deep-find');

var obj = {
  employee:{
    name: {
      first: 'yash',
      last: 'singh'
    }
  }
}

deepFind(obj, 'employee.name.first');

Methods

var deepFind = require('deep-find');

deepFind([object], [array])

pass array as argument

var deepFind = require('deep-find');
var obj = {
  employees: [{
    name: {
      first: 'yash',
      last: 'singh'
    }
  }, {
    name: {
      first: 'ruby',
      last: 'singh'
    }
  }]
}

var value = deepFind(obj, ['employees[0]', 'name', 'first']);

deepFind([object], [string])

pass string as argument

var deepFind = require('deep-find');
var obj = {
  employees: [{
    name: {
      first: 'yash',
      last: 'singh'
    }
  }, {
    name: {
      first: 'ruby',
      last: 'singh'
    }
  }]
}

var value = deepFind(obj, 'employees[0].name.first');

Run Test

npm test

Benchmark

node benchmark.js
regular search x 1,212,008 ops/sec ±1.61% (81 runs sampled)

Contribute or Report Issue

For bugs and feature requests, please create an issue.

License

MIT © Yashprit Singh

Keywords

FAQs

Package last updated on 05 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc