srvx-nightly 1.0.3 → 1.0.4
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/_chunks/_plugins.mjs +1 -1
- package/dist/adapters/node.mjs +2 -2
- package/dist/cli.mjs +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ const errorPlugin = (server) => {
|
|
|
15
15
|
server.options.middleware.unshift((_req, next) => {
|
|
16
16
|
try {
|
|
17
17
|
const res = next();
|
|
18
|
-
return res
|
|
18
|
+
return typeof res?.then === "function" ? res.then(void 0, (error) => errorHandler(error)) : res;
|
|
19
19
|
} catch (error) {
|
|
20
20
|
return errorHandler(error);
|
|
21
21
|
}
|
package/dist/adapters/node.mjs
CHANGED
|
@@ -1139,7 +1139,7 @@ function toNodeHandler(handler, options) {
|
|
|
1139
1139
|
maxRequestBodySize: options?.maxRequestBodySize,
|
|
1140
1140
|
trustProxy: options?.trustProxy
|
|
1141
1141
|
}));
|
|
1142
|
-
return res
|
|
1142
|
+
return typeof res?.then === "function" ? res.then((resolvedRes) => send(nodeRes, resolvedRes)) : send(nodeRes, res);
|
|
1143
1143
|
}
|
|
1144
1144
|
convertedNodeHandler.__fetchHandler = handler;
|
|
1145
1145
|
assignFnName(convertedNodeHandler, handler, " (converted to Node handler)");
|
|
@@ -1205,7 +1205,7 @@ var NodeServer = class {
|
|
|
1205
1205
|
} catch (error) {
|
|
1206
1206
|
return sendErrorResponse(nodeRes, error, this.options.silent);
|
|
1207
1207
|
}
|
|
1208
|
-
return res
|
|
1208
|
+
return typeof res?.then === "function" ? res.then((resolvedRes) => sendNodeResponseDetached(nodeRes, resolvedRes, this.options.silent), (error) => sendErrorResponse(nodeRes, error, this.options.silent)) : sendNodeResponseDetached(nodeRes, res, this.options.silent);
|
|
1209
1209
|
};
|
|
1210
1210
|
this.node = {
|
|
1211
1211
|
handler,
|
package/dist/cli.mjs
CHANGED