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