Sorry, the diff of this file is not supported yet
+3
-2
@@ -34,6 +34,7 @@ (function() { | ||
| deprecate: function(message) { | ||
| var deprecation, methodName, stack; | ||
| var deprecation, deprecations, methodName, stack; | ||
| stack = Deprecation.generateStack().slice(1); | ||
| methodName = Deprecation.getFunctionNameFromCallsite(stack[0]); | ||
| if (!(deprecation = global.__grimDeprecations__.find(function(d) { | ||
| deprecations = global.__grimDeprecations__; | ||
| if (!(deprecation = _.find(deprecations, function(d) { | ||
| return d.getOriginName() === methodName; | ||
@@ -40,0 +41,0 @@ }))) { |
+1
-1
| { | ||
| "name": "grim", | ||
| "version": "0.9.0", | ||
| "version": "0.10.0", | ||
| "description": "Log usage of deprecated methods", | ||
@@ -5,0 +5,0 @@ "main": "./lib/grim", |
+20
-2
@@ -1,3 +0,21 @@ | ||
| # Grim [](https://travis-ci.org/atom/grim) | ||
| # Grim [](https://travis-ci.org/atom/grim) | ||
| Log usage of deprecated methods | ||
| Log deprecate calls | ||
| ## Installing | ||
| ```sh | ||
| npm install grim | ||
| ``` | ||
| ## Usage | ||
| ```javascript | ||
| Grim = require('Grim') | ||
| function someOldMethod() { | ||
| Grim.deprecate("Use theNewMethod instead.") | ||
| } | ||
| ``` | ||
| To view all calls to deprecated methods use `Grim.logDeprecations()` or get direct access to the deprecated calls by using `Grim.getDeprecations()` |
7888
4.26%6
20%151
0.67%22
450%