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

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    4
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i prop-transform

Weekly Downloads

4

Version

1.0.3

License

Apache-2.0

Unpacked Size

13.9 kB

Total Files

6

Last publish

Collaborators

  • savelbr