Revert "feat: add _hooks metadata object to all hooks that have object-type params"

This reverts commit 46899ccadb.
v1.18.x
Barış Soner Uşaklı 4 years ago
parent db48b9527d
commit 7c1e163d82

@ -96,17 +96,6 @@ Hooks.fire = async function (hook, params) {
winston.warn(`[plugins] Unknown hookType: ${hookType}, hook : ${hook}`); winston.warn(`[plugins] Unknown hookType: ${hookType}, hook : ${hook}`);
return; return;
} }
if (params === undefined) { // can't be simpler falsy check, empty strings can be passed e.g. filter:parse.raw
params = {};
}
if (typeof params === 'object') {
params._hook = Object.freeze({
name: hook,
type: hookType,
listeners: hookList && Array.isArray(hookList) ? hookList.length : 0,
});
}
const result = await hookTypeToMethod[hookType](hook, hookList, params); const result = await hookTypeToMethod[hookType](hook, hookList, params);
if (hook !== 'action:plugins.firehook' && hook !== 'filter:plugins.firehook') { if (hook !== 'action:plugins.firehook' && hook !== 'filter:plugins.firehook') {

Loading…
Cancel
Save