@web-ts-toolkit/express-response-handler 0.23.0 → 0.24.0
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/README.md +1 -0
- package/create-handler.js +3 -0
- package/create-handler.mjs +3 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ pnpm add @web-ts-toolkit/express-response-handler
|
|
|
14
14
|
- return explicit `HttpResponse` wrappers for status control
|
|
15
15
|
- throw typed HTTP errors
|
|
16
16
|
- switch between simple, AIP-193, and RFC 9457-style error payloads
|
|
17
|
+
- if a wrapped handler returns `undefined`, the library assumes the handler will manage the response itself
|
|
17
18
|
|
|
18
19
|
## Quick Start
|
|
19
20
|
|
package/create-handler.js
CHANGED
|
@@ -121,6 +121,9 @@ function createHandler(options = {}) {
|
|
|
121
121
|
if (shouldSkipResponse(res, event)) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
+
if (data === void 0) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
124
127
|
if (data instanceof import_responses.Response) {
|
|
125
128
|
res.status(data.statusCode).json(data.data);
|
|
126
129
|
return;
|
package/create-handler.mjs
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@web-ts-toolkit/express-response-handler",
|
|
3
3
|
"description": "FastAPI-style return-value response handling for Express",
|
|
4
4
|
"homepage": "https://web-ts-toolkit.pages.dev/docs/packages/express-response-handler",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.24.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"keywords": [
|
|
8
8
|
"express",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@fast-csv/format": "^5.0.5",
|
|
54
|
-
"@web-ts-toolkit/http-errors": "0.
|
|
55
|
-
"@web-ts-toolkit/utils": "0.
|
|
54
|
+
"@web-ts-toolkit/http-errors": "0.24.0",
|
|
55
|
+
"@web-ts-toolkit/utils": "0.24.0"
|
|
56
56
|
},
|
|
57
57
|
"files": [
|
|
58
58
|
"**/*",
|