refactor: remove unused, duplicated code in deprecate module (#14579)
* remove obsolete tests * remove unused deprecate API * make a warnOnce helper for the deprecate methods * misc. copyediting, e.g. variable names, whitespace * test that any deprecation warns once at most * use strict
This commit is contained in:
parent
d78a2a110a
commit
a3f7e298cf
3 changed files with 71 additions and 97 deletions
|
@ -44,7 +44,9 @@ const nativeFn = app.getAppMetrics
|
|||
app.getAppMetrics = () => {
|
||||
let metrics = nativeFn.call(app)
|
||||
for (const metric of metrics) {
|
||||
deprecate.removeProperty(metric, 'memory', true)
|
||||
if ('memory' in metric) {
|
||||
deprecate.removeProperty(metric, 'memory')
|
||||
}
|
||||
}
|
||||
|
||||
return metrics
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue