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:
Charles Kerr 2018-09-12 17:13:22 -05:00 committed by GitHub
parent d78a2a110a
commit a3f7e298cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 97 deletions

View file

@ -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