define-configurable
1.0.12 • Public • Published define-configurable
Defines new (or modifies existing) properties using Object.defineProperty on an object passed to define as this, setting configurable by default
--
Simple
const define = require('define-configurable')
const subject = {}
const props = [
{ one: true },
{ two () {
console.log('do nothing')
}
}
]
define.apply(subject, props)
Extend
const define = require('define-configurable')
const subject = {
search (arg) {}
}
define.apply(subject, {
extend: {
search (method, arg) {
return method.call(this, arg)
}
}
})
Package Sidebar
Install
npm i define-configurable
Weekly Downloads