value-descriptors-factory
exports a function that builds Object.degineProperties
value descriptors without verbosity.
$ npm install value-descriptors-factory --save
const vdf = require('value-descriptors-factory')
const obj1 = Object.defineProperties(vdf({
foo: 'bar',
fizz: 'buzz'
}))
// is equivalent to
const obj2 = Object.defineProperties({
foo: {
value: 'bar',
},
fizz: {
value: 'buzz'
}
}))
- Node.js >=6
- ES2015 transpilers
MIT