-
-
Notifications
You must be signed in to change notification settings - Fork 790
Open
Labels
enhancementNew feature or request.New feature or request.
Description
What is the feature you are proposing?
What is the feature you are proposing?
Introduce a LinearRouter.matchRoute
static method that allows developers to use the route-matching logic directly, without needing to:
- Initialize a full router instance, and
- Add routes only to then check if a path matches.
This would simply abstract the logic already implemented in the router’s existing match
function, but make it accessible as a standalone utility.
Why is this needed?
The route-matching logic is useful outside the context of a full router.
Providing matchRoute
as a direct method would:
- Simplify testing (check if a path would match a given route definition).
- Help with debugging (inspect how a route resolves without building a router).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request.New feature or request.