hookable 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -128,19 +128,13 @@ class Hookable {
128
128
  }
129
129
  }
130
130
  callHook(name, ...args) {
131
- if (this._hooks[name]) {
132
- return serialCaller(this._hooks[name], args);
133
- }
131
+ return serialCaller(this._hooks[name] || [], args);
134
132
  }
135
133
  callHookParallel(name, ...args) {
136
- if (this._hooks[name]) {
137
- return parallelCaller(this._hooks[name], args);
138
- }
134
+ return parallelCaller(this._hooks[name] || [], args);
139
135
  }
140
136
  callHookWith(caller, name, ...args) {
141
- if (this._hooks[name]) {
142
- return caller(this._hooks[name], args);
143
- }
137
+ return caller(this._hooks[name] || [], args);
144
138
  }
145
139
  }
146
140
  function createHooks() {
package/dist/index.mjs CHANGED
@@ -124,19 +124,13 @@ class Hookable {
124
124
  }
125
125
  }
126
126
  callHook(name, ...args) {
127
- if (this._hooks[name]) {
128
- return serialCaller(this._hooks[name], args);
129
- }
127
+ return serialCaller(this._hooks[name] || [], args);
130
128
  }
131
129
  callHookParallel(name, ...args) {
132
- if (this._hooks[name]) {
133
- return parallelCaller(this._hooks[name], args);
134
- }
130
+ return parallelCaller(this._hooks[name] || [], args);
135
131
  }
136
132
  callHookWith(caller, name, ...args) {
137
- if (this._hooks[name]) {
138
- return caller(this._hooks[name], args);
139
- }
133
+ return caller(this._hooks[name] || [], args);
140
134
  }
141
135
  }
142
136
  function createHooks() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hookable",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Awaitable hook system",
5
5
  "keywords": [
6
6
  "hook",