mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
chore: add standalone function deprecation helper (#16782)
This commit is contained in:
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user