prop-transform

1.0.3 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i prop-transform

Weekly Downloads

3

Version

1.0.3

License

Apache-2.0

Unpacked Size

13.9 kB

Total Files

6

Last publish

Collaborators

  • savelbr