ramped.make_object
v0.2.0
Published
Build properties of an object from functions applied to a single input.
Downloads
3
Readme
Ramped make object
Build properties of an object from functions applied to a single argument.
Like Ramda applySpec, but only accepts a single argument. Which is similar to Ramda.evolve but this passes in the entire object instead of just the value of each key.
Install
To add as a dependency to a Node.js project:
npm i ramped.make_object --save
Usage
make_object = require('ramped.make_object')
convert = make_object({
c: R.prop('a'),
d: R.prop('b')
})
new_object = convert({a: 1, b: 2})
// {c: 1, d: 2}