hono 3.0.4 → 3.0.5

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.
@@ -120,12 +120,12 @@ const mergePath = (...paths) => {
120
120
  return p;
121
121
  };
122
122
  const checkOptionalParameter = (path) => {
123
- const match = path.match(/(^.+)(\/\:[^\/]+)\?$/);
123
+ const match = path.match(/^(.+|)(\/\:[^\/]+)\?$/);
124
124
  if (!match)
125
125
  return null;
126
126
  const base = match[1];
127
127
  const optional = base + match[2];
128
- return [base, optional];
128
+ return [base === "" ? "/" : base.replace(/\/$/, ""), optional];
129
129
  };
130
130
  const removeFragment = (queryString) => {
131
131
  const fragIndex = queryString.indexOf("#");
package/dist/utils/url.js CHANGED
@@ -90,12 +90,12 @@ var mergePath = (...paths) => {
90
90
  return p;
91
91
  };
92
92
  var checkOptionalParameter = (path) => {
93
- const match = path.match(/(^.+)(\/\:[^\/]+)\?$/);
93
+ const match = path.match(/^(.+|)(\/\:[^\/]+)\?$/);
94
94
  if (!match)
95
95
  return null;
96
96
  const base = match[1];
97
97
  const optional = base + match[2];
98
- return [base, optional];
98
+ return [base === "" ? "/" : base.replace(/\/$/, ""), optional];
99
99
  };
100
100
  var removeFragment = (queryString) => {
101
101
  const fragIndex = queryString.indexOf("#");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Ultrafast web framework for the Edge",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",