@web-ts-toolkit/express-response-handler 0.23.0 → 0.25.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 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;
@@ -95,6 +95,9 @@ function createHandler(options = {}) {
95
95
  if (shouldSkipResponse(res, event)) {
96
96
  return;
97
97
  }
98
+ if (data === void 0) {
99
+ return;
100
+ }
98
101
  if (data instanceof Response) {
99
102
  res.status(data.statusCode).json(data.data);
100
103
  return;
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.23.0",
5
+ "version": "0.25.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.23.0",
55
- "@web-ts-toolkit/utils": "0.23.0"
54
+ "@web-ts-toolkit/http-errors": "0.25.0",
55
+ "@web-ts-toolkit/utils": "0.25.0"
56
56
  },
57
57
  "files": [
58
58
  "**/*",