Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grim

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grim - npm Package Compare versions

Comparing version 0.4.0 to 0.6.0

28

lib/grim.js

@@ -9,3 +9,3 @@ (function() {

module.exports = {
log: function() {
getLog: function() {
return _.clone(log);

@@ -16,4 +16,22 @@ },

},
logDeprecationWarnings: function() {
var metadata, method, warnings, _i, _len, _ref, _results;
warnings = [];
for (method in log) {
metadata = log[method];
warnings.push([method, metadata]);
}
warnings.sort(function(a, b) {
return b[1].count - a[1].count;
});
console.warn("\nCalls to deprecated functions\n-----------------------------");
_results = [];
for (_i = 0, _len = warnings.length; _i < _len; _i++) {
_ref = warnings[_i], method = _ref[0], metadata = _ref[1];
_results.push(console.warn("(" + metadata.count + ") " + method + " : " + metadata.message, metadata));
}
return _results;
},
deprecate: function(message) {
var e, method, stackLines;
var all, e, method, stackLines, _ref;
try {

@@ -24,9 +42,9 @@ throw new Error("Deprecated Method");

stackLines = e.stack.split("\n");
method = stackLines[2].replace(/^\s*at\s*/, '');
_ref = stackLines[2].match(/^\s*at\s*(\S+)/), all = _ref[0], method = _ref[1];
}
if (log[method] == null) {
log[method] = {
stackTraces: [],
message: message,
count: 0
count: 0,
stackTraces: []
};

@@ -33,0 +51,0 @@ }

2

package.json
{
"name": "grim",
"version": "0.4.0",
"version": "0.6.0",
"description": "Log usage of deprecated methods",

@@ -5,0 +5,0 @@ "main": "./lib/grim",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc