Pluck nested properties from an object.
You can also pass in an array of string keys, in case you want to avoid splitting a key which is intended to have dots in it.
To pluck values from an array, you can simply use it with
Usage ##

pluck = plucker(path) ###
Given a dot-delimted propertypath
, returns a plucking function.You can also pass in an array of string keys, in case you want to avoid splitting a key which is intended to have dots in it.
pluck(object) ###
Pass this function an object to pluck the nested value from it.To pluck values from an array, you can simply use it with
[].map
, like so:var pluck = require('plucker')
var array = require('./data.json')
return array.map(
pluck('some.nested.value')
)
plucker(path, object) ###
Shorthand forplucker(path)(object)
.