chore: add standalone function deprecation helper (#16782)
This commit is contained in:
parent
c8282efb75
commit
e790dbd737
2 changed files with 37 additions and 3 deletions
|
@ -35,6 +35,14 @@ const deprecate = {
|
|||
}
|
||||
},
|
||||
|
||||
function: (fn, newName) => {
|
||||
const warn = warnOnce(fn.name, newName)
|
||||
return function () {
|
||||
warn()
|
||||
fn.apply(this, arguments)
|
||||
}
|
||||
},
|
||||
|
||||
event: (emitter, oldName, newName) => {
|
||||
const warn = newName.startsWith('-') /* internal event */
|
||||
? warnOnce(`${oldName} event`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue