alias-decorator
v2.0.0
Published
Alias methods via an ES7 decorator
Downloads
10
Readme
alias-decorator
Alias methods via an ES7 decorator
Installing
$ npm install alias-decorator
Usage
import alias from 'alias-decorator'
class Dog {
@alias('bark', 'growl')
speak () {
console.log('woof')
}
}
const dog = new Dog()
dog.speak === dog.bark // true
dog.bark === dog.growl // true
alias
copies your property descriptor directly, so properties like enumerable
are preserved.