Closed kitsonk closed 7 years ago
@@ master #223 diff @@
==========================================
Files 44 46 +2
Lines 2326 2450 +124
Methods 26 27 +1
Messages 0 0
Branches 445 472 +27
==========================================
+ Hits 2266 2387 +121
- Misses 56 59 +3
Partials 4 4
Powered by Codecov. Last update 3c14776...dcfc4b7
This PR provides a new module named
instrument
which exports 3 functions:deprecated
deprecatedAdvice
deprecatedDecorator
deprecated
allows you to log toconsole.warn
when running in debug mode (which is the default fordojo-has
) to signals that something is deprecated. It takes an options bag which allows the specification of a different message, the name of the function being deprecated, a URL for additional information and an alternative warn function.The
deprecatedAdvice
generates an before advising function which will calldeprecated
.The
deprecatedDecorator
is a method decorator which will calldeprecated
. It also will automatically determine thename
for the options based on the class and method names.Resolves #220