How to use the grim.getDeprecations function in grim

To help you get started, we’ve selected a few grim examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atom / atom / src / task-bootstrap.js View on Github external
return Grim.on('updated', function() {
    const deprecations = Grim.getDeprecations().map(deprecation =>
      deprecation.serialize()
    );
    Grim.clearDeprecations();
    return global.emit('task:deprecations', deprecations);
  });
};
github atom / metrics / lib / metrics.js View on Github external
setImmediate(() => {
        for (let deprecation of grim.getDeprecations()) {
          this.reportDeprecation(deprecation)
        }
      })
    })
github atom / atom / packages / deprecation-cop / lib / deprecation-cop-view.js View on Github external
getDeprecatedCallsByPackageName() {
    const deprecatedCalls = Grim.getDeprecations();
    deprecatedCalls.sort((a, b) => b.getCallCount() - a.getCallCount());
    const deprecatedCallsByPackageName = {};
    for (const deprecation of deprecatedCalls) {
      const stacks = deprecation.getStacks();
      stacks.sort((a, b) => b.callCount - a.callCount);
      for (const stack of stacks) {
        let packageName = null;
        if (stack.metadata && stack.metadata.packageName) {
          packageName = stack.metadata.packageName;
        } else {
          packageName = (this.getPackageName(stack) || '').toLowerCase();
        }

        deprecatedCallsByPackageName[packageName] =
          deprecatedCallsByPackageName[packageName] || [];
        deprecatedCallsByPackageName[packageName].push({ deprecation, stack });

grim

Log usage of deprecated methods

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis