1
0
Fork 0

🚨 Better handling of array check

This commit is contained in:
Joost De Cock 2018-08-13 10:54:14 +02:00
parent 9c5b478b0a
commit 7308f2dda6

View file

@ -223,7 +223,10 @@ Pattern.prototype.loadPluginHooks = function(plugin) {
for (let hook of this.hooks.all) {
if (typeof plugin.hooks[hook] === "function") {
this.on(hook, plugin.hooks[hook]);
} else if (typeof plugin.hooks[hook] === "array") {
} else if (
typeof plugin.hooks[hook] !== "undefined" &&
plugin.hooks[hook].isArray()
) {
for (let method of plugin.hooks[hook]) {
this.on(hook, method);
}