defines new or modifies properties on an object with data/accessor descriptor
$ component install wryk/properties
//use properties for es6 Object.is and Object.mixin monkey-patch
var properties = require('properties');
var is = function (a, b) {
//code for es6 Object.is shim
};
var mixin = function (target, source) {
//code for es6 Object.mixin shim
};
properties(Object)
//use sugar form for is
.property('is')
.configurable()
.writable()
.enumerable(false)
.value(is)
.define()
//use basic form for mixin
.property('mixin', {
configurable: true,
writable: true,
enumerable: false,
value: mixin
})
;
//or you can use default method
properties(Object)
//default descriptor
.default({ writable: true, configurable: true, enumerable: false })
//sugar form
.property('is')
.value(is)
.define()
//basic form
.property('mixin', {
value: mixin
})
;
First, make sure dependencies are installed:
$ npm install
and run test:
$ make test
MIT