Skip to content

Children are not matched when parent's sibling has a shorter path #18

Description

@whs

Sorry for the title, I don't know how to describe this problem clearly.

This is probably related to #17. The case can be demonstrated by this test:

it('should able to match longer subpath that has similar path on the root', ( ) => {

    const node = new RouteNode('', '', [
        new RouteNode('a', '/:x/:y'),
        new RouteNode('b', '/', [
            new RouteNode('c', 'a/b/c'),
        ]),
    ]);

    withoutMeta(node.matchPath('/a/b/c')).should.eql({ name: 'c', params: { } });

});

matchPath will return {} even though there is a route for /a/b/c

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions