Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There seems to be a problem with findAllRoutes boundaries #124

Closed
medz opened this issue Jul 26, 2024 · 1 comment · Fixed by #128
Closed

There seems to be a problem with findAllRoutes boundaries #124

medz opened this issue Jul 26, 2024 · 1 comment · Fixed by #128
Labels
bug Something isn't working

Comments

@medz
Copy link

medz commented Jul 26, 2024

Environment

Bun

Reproduction

import { createRouter, addRoute, findAllRoutes } from "rou3";

const router = createRouter();

addRoute(router, "get", "/path", "Static");
addRoute(router, "get", "/path/:name", "Param");

console.log(findAllRoutes(router, "get", "/path"));

Describe the bug

Register two routes: /path and /path/:name, or add another route: /path/:bar/:qaz

Use /path to call findAllRoutes, and the result includes /path/:name and /path/:bar/:qaz routes.

Additional context

No response

Logs

[
  {
    data: "Param",
    params: {
      name: undefined,
    },
  }, {
    data: "Static",
    params: undefined,
  }
]
@medz medz added the bug Something isn't working label Jul 26, 2024
@pi0
Copy link
Member

pi0 commented Jul 26, 2024

Thanks for report i kinda forgot to do it for findAll too before release. We need to do similar fix of #123. (feel free to PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants