@bool-ts/core 1.7.1 → 1.7.3
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/hooks/factory.js +5 -2
- package/package.json +1 -1
- package/src/hooks/factory.ts +6 -4
package/dist/hooks/factory.js
CHANGED
|
@@ -200,7 +200,7 @@ export const moduleResolution = async (module, options) => {
|
|
|
200
200
|
routerGroup
|
|
201
201
|
});
|
|
202
202
|
};
|
|
203
|
-
const fetcher = async (bun, bool
|
|
203
|
+
const fetcher = async (bun, bool) => {
|
|
204
204
|
const { query, route: { parameters, model }, moduleResolution: { startMiddlewareGroup, endMiddlewareGroup, guardGroup, openDispatcherGroup, closeDispatcherGroup } } = bool;
|
|
205
205
|
const { request, server: _server } = bun;
|
|
206
206
|
const context = {
|
|
@@ -528,6 +528,9 @@ const fetcher = async (bun, bool, options) => {
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
context[responseBodyArgsKey] = await collection.func(...args);
|
|
531
|
+
if (context[responseBodyArgsKey] instanceof Response) {
|
|
532
|
+
return responseConverter(context[responseBodyArgsKey]);
|
|
533
|
+
}
|
|
531
534
|
}
|
|
532
535
|
if (context[responseBodyArgsKey] instanceof Response) {
|
|
533
536
|
return responseConverter(context[responseBodyArgsKey]);
|
|
@@ -590,7 +593,7 @@ export const BoolFactory = async (modules, options) => {
|
|
|
590
593
|
query: query,
|
|
591
594
|
route: collection.route,
|
|
592
595
|
moduleResolution: collection.resolution
|
|
593
|
-
}
|
|
596
|
+
});
|
|
594
597
|
}
|
|
595
598
|
catch (error) {
|
|
596
599
|
options.debug && console.error(error);
|
package/package.json
CHANGED
package/src/hooks/factory.ts
CHANGED
|
@@ -322,8 +322,7 @@ const fetcher = async (
|
|
|
322
322
|
query: Record<string, unknown>;
|
|
323
323
|
route: NonNullable<ReturnType<RouterGroup["find"]>>;
|
|
324
324
|
moduleResolution: NonNullable<Awaited<ReturnType<typeof moduleResolution>>>;
|
|
325
|
-
}
|
|
326
|
-
options: TBoolFactoryOptions
|
|
325
|
+
}>
|
|
327
326
|
) => {
|
|
328
327
|
const {
|
|
329
328
|
query,
|
|
@@ -850,6 +849,10 @@ const fetcher = async (
|
|
|
850
849
|
}
|
|
851
850
|
|
|
852
851
|
context[responseBodyArgsKey] = await collection.func(...args);
|
|
852
|
+
|
|
853
|
+
if (context[responseBodyArgsKey] instanceof Response) {
|
|
854
|
+
return responseConverter(context[responseBodyArgsKey]);
|
|
855
|
+
}
|
|
853
856
|
}
|
|
854
857
|
|
|
855
858
|
if (context[responseBodyArgsKey] instanceof Response) {
|
|
@@ -951,8 +954,7 @@ export const BoolFactory = async (
|
|
|
951
954
|
query: query,
|
|
952
955
|
route: collection.route,
|
|
953
956
|
moduleResolution: collection.resolution
|
|
954
|
-
}
|
|
955
|
-
options
|
|
957
|
+
}
|
|
956
958
|
);
|
|
957
959
|
} catch (error) {
|
|
958
960
|
options.debug && console.error(error);
|