chore: add removeFunction to deprecate module (#14468)

* chore: add removeFunction function to deprecate api

* re-comment deprecate.member
This commit is contained in:
Shelley Vohr 2018-09-05 21:55:28 -07:00 committed by GitHub
parent 7f22442228
commit 9bf1fb323b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,9 +73,7 @@ deprecate.setHandler = (handler) => {
deprecate.getHandler = () => deprecationHandler
// None of the below methods are used, and so will be commented
// out until such time that they are needed to be used and tested.
// Commented out until such time as it is needed
// // Forward the method to member.
// deprecate.member = (object, method, member) => {
// let warned = false
@ -88,9 +86,17 @@ deprecate.getHandler = () => deprecationHandler
// }
// }
// Remove a property with no replacement
deprecate.removeProperty = (object, deprecatedName) => {
if (!process.noDeprecation) {
deprecate.log(`The '${deprecatedName}' property has been deprecated.`)
deprecate.log(`The '${deprecatedName}' property of ${object} has been deprecated and marked for removal.`)
}
}
// Remove a function with no replacement
deprecate.removeFunction = (deprecatedName) => {
if (!process.noDeprecation) {
deprecate.log(`The '${deprecatedName}' function has been deprecated and marked for removal.`)
}
}