Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return Grim.on('updated', function() {
const deprecations = Grim.getDeprecations().map(deprecation =>
deprecation.serialize()
);
Grim.clearDeprecations();
return global.emit('task:deprecations', deprecations);
});
};
setImmediate(() => {
for (let deprecation of grim.getDeprecations()) {
this.reportDeprecation(deprecation)
}
})
})
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 });