Proper way to implement the decorator pattern in js?

Proper way to implement the decorator pattern in js?

Let's say you you were using a 3rd-party library that had a Hammer object as part of its api, and you wanted to decorate the swing() method to log every time it's called. What is the proper way to do this in js?