Decorate a function, forwarding properties.
const decorate = require('@npm/decorate')
function myFunction () {
return 1
}
myFunction.bloo = 3
const decorated = decorate(myFunction, (...args) => {
return myFunction(...args) + 1
})
console.log(decorated.name) // myFunction
console.log(decorated.bloo) // 3
console.log(decorated()) // 2
Forward all properties from inner to a merged function that calls wrapper.
Return the inner function of a decorated function. or null.
Return an iterator that yields all decoration wrappers of a given function in order.
ISC