@vida-global/core 1.1.11 → 1.1.13
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.
|
@@ -39,6 +39,7 @@ class VidaServerController {
|
|
|
39
39
|
get contentType() { return this.requestHeaders['content-type']; }
|
|
40
40
|
get logger() { return logger; }
|
|
41
41
|
get rendered() { return this.#rendered }
|
|
42
|
+
markRendered() { this.#rendered = true; }
|
|
42
43
|
|
|
43
44
|
get statusCode() { return this._response.statusCode; }
|
|
44
45
|
set statusCode(_status) { this._response.statusCode = _status; }
|
|
@@ -182,13 +183,20 @@ class VidaServerController {
|
|
|
182
183
|
async #runCallbacks(callbacksList, actionName) {
|
|
183
184
|
for (const { callback, options } of callbacksList) {
|
|
184
185
|
if (!this.#shouldRunCallback(actionName, options)) continue;
|
|
185
|
-
|
|
186
|
+
const result = await this.#runCallback(callback)
|
|
187
|
+
if (result === false) return false;
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
return true;
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
|
|
194
|
+
async #runCallback(callback) {
|
|
195
|
+
if (typeof callback == 'function') return await callback.call(this);
|
|
196
|
+
return await this[callback]();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
192
200
|
#shouldRunCallback(actionName, options) {
|
|
193
201
|
if (options.only) {
|
|
194
202
|
if (Array.isArray(options.only)) return options.only.includes(actionName);
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vida-global/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"description": "Core libraries for supporting Vida development",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
9
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
10
|
+
"release": "node ./scripts/release.js",
|
|
11
|
+
"develop": "node ./scripts/release.js develop"
|
|
10
12
|
},
|
|
11
13
|
"jest": {
|
|
12
14
|
"collectCoverage": true,
|