1.0.0 • Published 7 years ago

get-nested-prop v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Install

$ npm install --save get-nested-prop
# OR
$ yarn add get-nested-prop

Usage

const getNestedProp = require('get-nested-prop')

const obj = {
  foo: {
    bar: {
      baz: 5
    }
  }
}

console.log(getNestedProp(obj, 'foo.bar.baz')) // 5
console.log(getNestedProp(obj, 'foo.bar.baz.boo', 5))  // 5

Contribute

Contributions are welcome. Please open up an issue or create PR if you would like to help out.

Note: If editing the README, please conform to the standard-readme specification.

License

Licensed under the MIT License.