diff --git a/.changeset/clean-windows-report.md b/.changeset/clean-windows-report.md new file mode 100644 index 00000000..be431e13 --- /dev/null +++ b/.changeset/clean-windows-report.md @@ -0,0 +1,5 @@ +--- +'@hono/medley-router': patch +--- + +fix: support new path matching diff --git a/packages/medley-router/package.json b/packages/medley-router/package.json index be994382..8be9c7d4 100644 --- a/packages/medley-router/package.json +++ b/packages/medley-router/package.json @@ -25,12 +25,12 @@ }, "homepage": "https://github.com/honojs/middleware", "peerDependencies": { - "hono": "*" + "hono": ">=3.8.0" }, "devDependencies": { - "hono": "^3.2.6" + "hono": "^3.9.2" }, "dependencies": { "@medley/router": "^0.2.1" } -} +} \ No newline at end of file diff --git a/packages/medley-router/src/router.ts b/packages/medley-router/src/router.ts index 580eab9f..faf91503 100644 --- a/packages/medley-router/src/router.ts +++ b/packages/medley-router/src/router.ts @@ -17,16 +17,13 @@ export class MedleyRouter implements Router { store[method] = handler } - match(method: string, path: string): Result | null { + match(method: string, path: string): Result { const route = this.router.find(path) if (route) { - return { - handlers: [route['store'][method]], - params: route['params'], - } + return [[[route['store'][method]], route['params']]] } - return null + return [[], []] } } diff --git a/yarn.lock b/yarn.lock index c8e49812..21bd2fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6147,7 +6147,7 @@ heap-js@^2.2.0: resolved "https://registry.yarnpkg.com/heap-js/-/heap-js-2.3.0.tgz#8eed2cede31ec312aa696eef1d4df0565841f183" integrity sha512-E5303mzwQ+4j/n2J0rDvEPBN7GKjhis10oHiYOgjxsmxYgqG++hz9NyLLOXttzH8as/DyiBHYpUrJTZWYaMo8Q== -hono@^3.0.0, hono@^3.1.0, hono@^3.1.2, hono@^3.1.5, hono@^3.2.6, hono@^3.5.1, hono@^3.5.2, hono@^3.5.8, hono@^3.7.2, hono@^3.7.3, hono@^3.9.1, hono@^3.9.2: +hono@^3.0.0, hono@^3.1.0, hono@^3.1.2, hono@^3.1.5, hono@^3.5.1, hono@^3.5.2, hono@^3.5.8, hono@^3.7.2, hono@^3.7.3, hono@^3.9.1, hono@^3.9.2: version "3.9.2" resolved "https://registry.yarnpkg.com/hono/-/hono-3.9.2.tgz#db31a6ce733131ee16bce0c9bd031a0708ebe052" integrity sha512-180NOiMadqU3lGmN6ajPDZvZPWus3a9mtVaAUR9uG0SImngBwRLA8vbnV0oUfUAgFT4nX55sGV9dVA06OuikHA==