@vida-global/core 1.1.11 → 1.1.12
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.
|
@@ -182,13 +182,20 @@ class VidaServerController {
|
|
|
182
182
|
async #runCallbacks(callbacksList, actionName) {
|
|
183
183
|
for (const { callback, options } of callbacksList) {
|
|
184
184
|
if (!this.#shouldRunCallback(actionName, options)) continue;
|
|
185
|
-
|
|
185
|
+
const result = await this.#runCallback(callback)
|
|
186
|
+
if (result === false) return false;
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
return true;
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
|
|
193
|
+
async #runCallback(callback) {
|
|
194
|
+
if (typeof callback == 'function') return await callback.call(this);
|
|
195
|
+
return await this[callback]();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
192
199
|
#shouldRunCallback(actionName, options) {
|
|
193
200
|
if (options.only) {
|
|
194
201
|
if (Array.isArray(options.only)) return options.only.includes(actionName);
|