@modern-js/plugin-bff 2.67.7 → 2.67.9

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.
@@ -94,7 +94,14 @@ const createHonoHandler = (handler) => {
94
94
  throw error;
95
95
  }
96
96
  } else {
97
- const args = Object.values(input.params).concat(input);
97
+ var _routePath_match;
98
+ const routePath = c.req.routePath;
99
+ const paramNames = ((_routePath_match = routePath.match(/:\w+/g)) === null || _routePath_match === void 0 ? void 0 : _routePath_match.map((s) => s.slice(1))) || [];
100
+ const params = Object.fromEntries(paramNames.map((name) => [
101
+ name,
102
+ input.params[name]
103
+ ]));
104
+ const args = Object.values(params).concat(input);
98
105
  try {
99
106
  const body = await handler(...args);
100
107
  if (c.finalized) {
@@ -80,7 +80,7 @@ var handleResponseMeta = function(c, handler) {
80
80
  var createHonoHandler = function(handler) {
81
81
  return function() {
82
82
  var _ref = _async_to_generator(function(c, next) {
83
- var input, response, result, error, args, body, e, error1;
83
+ var input, response, result, error, _routePath_match, routePath, paramNames, params, args, body, e, error1;
84
84
  return _ts_generator(this, function(_state) {
85
85
  switch (_state.label) {
86
86
  case 0:
@@ -148,7 +148,17 @@ var createHonoHandler = function(handler) {
148
148
  12
149
149
  ];
150
150
  case 6:
151
- args = Object.values(input.params).concat(input);
151
+ routePath = c.req.routePath;
152
+ paramNames = ((_routePath_match = routePath.match(/:\w+/g)) === null || _routePath_match === void 0 ? void 0 : _routePath_match.map(function(s) {
153
+ return s.slice(1);
154
+ })) || [];
155
+ params = Object.fromEntries(paramNames.map(function(name) {
156
+ return [
157
+ name,
158
+ input.params[name]
159
+ ];
160
+ }));
161
+ args = Object.values(params).concat(input);
152
162
  _state.label = 7;
153
163
  case 7:
154
164
  _state.trys.push([
@@ -60,7 +60,14 @@ const createHonoHandler = (handler) => {
60
60
  throw error;
61
61
  }
62
62
  } else {
63
- const args = Object.values(input.params).concat(input);
63
+ var _routePath_match;
64
+ const routePath = c.req.routePath;
65
+ const paramNames = ((_routePath_match = routePath.match(/:\w+/g)) === null || _routePath_match === void 0 ? void 0 : _routePath_match.map((s) => s.slice(1))) || [];
66
+ const params = Object.fromEntries(paramNames.map((name) => [
67
+ name,
68
+ input.params[name]
69
+ ]));
70
+ const args = Object.values(params).concat(input);
64
71
  try {
65
72
  const body = await handler(...args);
66
73
  if (c.finalized) {
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.67.7",
18
+ "version": "2.67.9",
19
19
  "jsnext:source": "./src/cli.ts",
20
20
  "types": "./dist/types/cli.d.ts",
21
21
  "main": "./dist/cjs/cli.js",
@@ -76,11 +76,11 @@
76
76
  "@babel/core": "^7.26.0",
77
77
  "@swc/helpers": "^0.5.17",
78
78
  "type-is": "^1.6.18",
79
- "@modern-js/bff-core": "2.67.7",
80
- "@modern-js/create-request": "2.67.7",
81
- "@modern-js/server-utils": "2.67.7",
82
- "@modern-js/server-core": "2.67.7",
83
- "@modern-js/utils": "2.67.7"
79
+ "@modern-js/bff-core": "2.67.9",
80
+ "@modern-js/create-request": "2.67.9",
81
+ "@modern-js/server-core": "2.67.9",
82
+ "@modern-js/server-utils": "2.67.9",
83
+ "@modern-js/utils": "2.67.9"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@types/babel__core": "^7.20.5",
@@ -93,12 +93,12 @@
93
93
  "typescript": "^5",
94
94
  "webpack": "^5.99.8",
95
95
  "zod": "^3.22.3",
96
- "@modern-js/app-tools": "2.67.7",
97
- "@modern-js/bff-runtime": "2.67.7",
98
- "@modern-js/core": "2.67.7",
99
- "@modern-js/plugin-v2": "2.67.7",
100
- "@modern-js/types": "2.67.7",
101
- "@modern-js/runtime": "2.67.7",
96
+ "@modern-js/app-tools": "2.67.9",
97
+ "@modern-js/bff-runtime": "2.67.9",
98
+ "@modern-js/core": "2.67.9",
99
+ "@modern-js/plugin-v2": "2.67.9",
100
+ "@modern-js/runtime": "2.67.9",
101
+ "@modern-js/types": "2.67.9",
102
102
  "@scripts/build": "2.66.0",
103
103
  "@scripts/jest-config": "2.66.0"
104
104
  },