Simple javascript function deccorator