Get unlimited public & private packages + team-based management with npm Teams.Learn more »

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

Install

npm i prop-transform

DownloadsWeekly Downloads

2

Version

1.0.3

License

Apache-2.0

Unpacked Size

13.9 kB

Total Files

6

Last publish

Collaborators

  • avatar