prop-transform
Functional wrapper around `dot-prop`
Last updated 2 years ago by savelbr .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install prop-transform 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.3                                ...           latest (2 years ago)

4 Versions

  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 6
Last Month 3
Dependencies (2)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |