Nostalgic Primordial Monster
Miss any of our Open RFC calls?Watch the recordings here! »

optional-value

0.2.0 • Public • Published

optional-value

optional-value finds out a value from nested object or array.

Install

# yarn 
$ yarn add optional-value
# npm 
$ npm install optional-value

Usage

import o from 'optional-value'
 
const someObject = {
  foo: {
    bar: 'hoge'
  }
}
const value = o(someObject, 'foo.bar')
// => hoge
const noneValue = o(someObject, 'foo.boo')
// => null
const obj = o(someObject, 'foo')
// => {bar: 'hoge'}

Keywords

none

Install

npm i optional-value

DownloadsWeekly Downloads

169

Version

0.2.0

License

MIT

Last publish

Collaborators

  • avatar