Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brechtcs/prop-transform
Wrapper function for `dot-prop`
https://github.com/brechtcs/prop-transform
Last synced: about 11 hours ago
JSON representation
Wrapper function for `dot-prop`
- Host: GitHub
- URL: https://github.com/brechtcs/prop-transform
- Owner: brechtcs
- License: apache-2.0
- Created: 2018-04-06T19:47:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-12T05:30:50.000Z (over 6 years ago)
- Last Synced: 2024-04-25T05:02:46.341Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prop-transform
Wrapper function for `dot-prop`, suitable for usage as an array mapper.
## Example
```js
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