Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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`

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