prop-transform
v1.0.3
Published
Functional wrapper around `dot-prop`
Downloads
7
Maintainers
Readme
prop-transform
Wrapper function for dot-prop
, suitable for usage as an array mapper.
Example
var transform = require('prop-transform')
var data = [{
nested: {
prop: 'stuff'
}
}, {
nested: {
prop: 'other'
}
}]
var output = data.map(transform('nested.prop', value => value.toUpperCase()))
console.log(output[0].nested.prop) // 'STUFF'
console.log(output[1].nested.prop) // 'OTHER'
License
Apache-2.0