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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.33latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.33
1.0.20
1.0.10
1.0.00

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