Skip to content

Add LinearRouter.matchRoute static method for direct matching #4412

@Digital39999

Description

@Digital39999

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:

  1. Initialize a full router instance, and
  2. 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

No one assigned

    Labels

    enhancementNew feature or request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions