@basket/get
v1.3.0
Published
Smart getter for js objects
Downloads
21
Readme
get
<a target="_blank" href="https://travis-ci.org/borovin/get"><img src="https://travis-ci.org/borovin/get.svg?branch=master" /></a>
<a target="_blank" href="https://codecov.io/gh/borovin/get"><img src="https://codecov.io/gh/borovin/get/branch/master/graph/badge.svg" /></a>
<a target="_blank" href="https://www.bithound.io/github/borovin/get"><img src="https://www.bithound.io/github/borovin/get/badges/score.svg"></a>
Smart property getter
const value = get(object, path); // => 'value'
Gets the value at path of object. If some segment of the path is undefined or null the result value will be undefined.
If some segment of the path is function it will be invoked with object context and returned value will be used.