moost 0.4.8 → 0.4.10
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 +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -144,7 +144,7 @@ function defineMoostEventHandler(options) {
|
|
|
144
144
|
setControllerContext(instance, options.controllerMethod || '', options.targetPath);
|
|
145
145
|
}
|
|
146
146
|
const interceptorHandler = await options.getIterceptorHandler();
|
|
147
|
-
if (interceptorHandler) {
|
|
147
|
+
if (interceptorHandler?.count) {
|
|
148
148
|
try {
|
|
149
149
|
response = await ci.with('Inteceptors:init', () => interceptorHandler.init());
|
|
150
150
|
if (response !== undefined) {
|
|
@@ -168,7 +168,7 @@ function defineMoostEventHandler(options) {
|
|
|
168
168
|
return endWithResponse(true);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
if (interceptorHandler) {
|
|
171
|
+
if (interceptorHandler?.countBefore) {
|
|
172
172
|
response = await ci.with('Inteceptors:before', () => interceptorHandler.fireBefore(response));
|
|
173
173
|
if (response !== undefined) {
|
|
174
174
|
return endWithResponse();
|
|
@@ -196,7 +196,7 @@ function defineMoostEventHandler(options) {
|
|
|
196
196
|
return endWithResponse(true);
|
|
197
197
|
}
|
|
198
198
|
async function endWithResponse(raise = false) {
|
|
199
|
-
if (interceptorHandler) {
|
|
199
|
+
if (interceptorHandler?.countAfter || interceptorHandler?.countOnError) {
|
|
200
200
|
try {
|
|
201
201
|
response = await ci.with('Inteceptors:after', () => interceptorHandler.fireAfter(response));
|
|
202
202
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -145,7 +145,7 @@ function defineMoostEventHandler(options) {
|
|
|
145
145
|
setControllerContext(instance, options.controllerMethod || '', options.targetPath);
|
|
146
146
|
}
|
|
147
147
|
const interceptorHandler = await options.getIterceptorHandler();
|
|
148
|
-
if (interceptorHandler) {
|
|
148
|
+
if (interceptorHandler?.count) {
|
|
149
149
|
try {
|
|
150
150
|
response = await ci.with('Inteceptors:init', () => interceptorHandler.init());
|
|
151
151
|
if (response !== undefined) {
|
|
@@ -169,7 +169,7 @@ function defineMoostEventHandler(options) {
|
|
|
169
169
|
return endWithResponse(true);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
if (interceptorHandler) {
|
|
172
|
+
if (interceptorHandler?.countBefore) {
|
|
173
173
|
response = await ci.with('Inteceptors:before', () => interceptorHandler.fireBefore(response));
|
|
174
174
|
if (response !== undefined) {
|
|
175
175
|
return endWithResponse();
|
|
@@ -197,7 +197,7 @@ function defineMoostEventHandler(options) {
|
|
|
197
197
|
return endWithResponse(true);
|
|
198
198
|
}
|
|
199
199
|
async function endWithResponse(raise = false) {
|
|
200
|
-
if (interceptorHandler) {
|
|
200
|
+
if (interceptorHandler?.countAfter || interceptorHandler?.countOnError) {
|
|
201
201
|
try {
|
|
202
202
|
response = await ci.with('Inteceptors:after', () => interceptorHandler.fireAfter(response));
|
|
203
203
|
}
|