0.1.0 • Published 7 years ago

value-descriptors-factory v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

value-descriptors-factory

travis ci npm version Coverage Status Dependency Status

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 to

const obj2 = Object.defineProperties({
    foo: {
        value: 'bar',
    },
    fizz: {
        value: 'buzz'
    }
}))

Support

  • Node.js >=6
  • ES2015 transpilers

License

MIT